views:

32

answers:

1

What is the correct way of showing a new View with more detailed information from a ListView in Android? It's a topic that I can't find a solid answer for in either of these Android books.

For example a list of contact names, one is selected and a view shows their full details.

Do I launch a new activity for this or use a ViewFlipper?

+1  A: 

Your approach is right. It's the recommended one. When designing an activity, it's suggested to use this paradigm:

One activity = one thing to do.

  • Viewing the list
  • Viewing the details

On the Notepad tutorial app, a new activity is launched to view the details of a list item.

Anyway, the ViewFlipper is another possible approach that keeps all the content in a single activity. This approach is suitable if you manage the Back key correctly.

DavLink
As a side question, is the best practice to pass a state object (the listview example) using a static variable on a class, or in the constructor?
Chris S