Hello List,
 I`ve created my own adapter for ListView and now I would like to
click on the items but I can`t. I`ve created something like this

        NewsArrayAdapter naa = new
NewsArrayAdapter(NewserActivity.this, R.layout.row, news);
        setListAdapter(naa);

        ListView lv = getListView();
        lv.setTextFilterEnabled(true);
        lv.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> parent, View view,
                int position, long id) {
              // When clicked, show a toast with the TextView text
              Toast.makeText(getApplicationContext(), ((TextView)
view).getText(),
                  Toast.LENGTH_SHORT).show();
            }
          });

But when I click on item I get error:

06-30 10:19:12.514: ERROR/AndroidRuntime(2578):     at
fixus.core.NewserActivity$1.onItemClick(NewserActivity.java:48)

The error is in this line:
Toast.makeText(getApplicationContext(), ((TextView) view).getText(),

Can anybody help me ?

best regards,
Dawid "Fixus" Pacholczyk

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to