listactivity - How to properly switch Activities in Android? -


I'm sure how to ask this question, but I need to allow users to switch between lists by clicking For example, I present to users with the name of the user, they click on a name, and a new list appears to be the message of that person. .

I'm just a single list activation and I use onListItemClick to listen to any click on a list. Then I change the list to setListAdapter (someArrayList) each time.

Certainly there is more intuitive solution than this. Does anyone point me to some tutorials how to do this?

You basically need a lot of activities, each of your lists, after that you start other activities. Can:

  intent = intent (new, new activity); StartActivity;   

edit - The startActivity can be attached before calling the parameter intent for the activities Is:

  intent. InputXA ("person", "Bob Smith");   

and later it was received in the next activity using:

  string person = intent .getStringExtra ("person");   

Then you will have a PeopleRecipher , a messaging functionality and the list inside that activity will only display those items



Comments