Android: having two listviews in two listactivities didn't work?

The reason I am using ListView is because my list is complicated, and I also extended ListAdapter. – Yang Apr 18 '10 at 21:26 Complexity should have nothing to do with it. You can extend BaseAdapter and override getView() as you were showed previously to return any kind of view you want.

Then simply get a reference to the ListView you defined and set its adapter to your custom one by calling setAdapter(adapter) on it. – jqpubliq Apr 18 '10 at 21:34 I unserstand what you are saying. I've already extended my adapter based on ListAdapter.

The thing is, If I don't extend ListActivity, I won't be able to call setListAdapter(). If I only extend Activity and setAdapter() as you mentioned, how can I make it a list? – Yang Apr 18 '10 at 21:59 1 If you read this you'll see that setListApapter just adds a list to the view and then sets the lists adapter.

So if you just add your own list set to fill_parent and call setAdapter() on it, it is equivalent. – jqpubliq Apr 18 '10 at 22:01.

Don't use ListActivities. Use Activities and have a ListView in the each xml which you can name however you want.

I guess my previous question wasn't clear enough ( http://stackoverflow.com/questions/2549585/android-failed-to-setcontentview-when-switching-to-listactivity ), so I explain as follows. As required by android, listview must have an ID which is exactly "@android:id/list". If I set the listview in both listview1 and listview2 with the same ID, then they will end up using the same format of listview, which is not what I want.

RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id. How do I handle this dilema?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions