Priyank
Priyank

Reputation: 14387

Design Clarification in Android. List Activity vs Activity

I have a simple question. I am trying to design a simple Android app, which based on keywords searches something and shows a listing view of results. Currently it merely searches SMSes in the cellphone.

Here are some of the things I am faced with:

If I wanted to can I actually open a SMS directly in inbox? How? (Any code snippets will be wonderful)

Assuming I wanted to bind this result list with an ListActivity; can Activity and ListActivity co-exist in same app? How? In anycase, what is the best way to design this kind of UI stuff in android. I am a rookie so I am not sure, how it goes.

For generic Android phone apps, what are the best practices to make UI as compliant to as many phones? Like what kind of views should I use?

Any help will be much appreciated.

Upvotes: 1

Views: 726

Answers (1)

Janusz
Janusz

Reputation: 189494

You can have more then one activity in your app. Think of an Activity as a Screen. That means you are using the first pure Activity for the startscreen. Then based on the user interactions you start another activity. If that is only a list that should be a listview, because it handles some nice things for you (Displaying a special textview if the list is empty, easy finding of the used list etc.)

Now you need an OnItemClickListener to react on user interactions with the list. Now you can start a third activity displaying the SMS details. This would be a normal activity again.

In this way you have three activities coexisting in your app and you have the three screens nicely separated in you code.

Don't forget to register all the activities in your manifest.xml to be able to start them.

Upvotes: 3

Related Questions