Skip to content Skip to sidebar Skip to footer

Setlistadapter Problem I Don't Know How This Works At All

I'm having trouble with the setListAdapter(). It tells me to just create the method because it doesn't know anything about it. I'm, for now, just trying to get a list to populate a

Solution 1:

setListAdapter() isn't a method you can call on an Activity (it is available on ListActivity but you're not using that). You're going to have to add a ListView into your layout (/res/layout/passwordscreen) and then find it and call setAdapter on that.

e.g.

ListViewlv= (ListView) findViewById(R.id.mylistview);
lv.setAdapter(.....);

Solution 2:

Hey That's because of base class, your base class should be:

publicclassyourClassNameextendsListActivity{

Not class yourClassName extends Activity{

Solution 3:

When you call setListAdapter this must extend ListActivity probably you class just extends Activity.

I saw it on some other post and it works for me!!

Post a Comment for "Setlistadapter Problem I Don't Know How This Works At All"