Menu layout advice please...

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Menu layout advice please...

Postby rackham » Wed Oct 28, 2009 5:06 pm

Hello everyone, I am posting as I would like some advice, this being my first exploration of the android platform I'm a little confused.

I want one of my activity's to be a menu, which looks like a common old ListView, with an icon and two lines of text in each. I only have 5 items but each one's touch action should be different, say one will start a new activity, one will activate a datePicker, one will open a browser and so on, also i would like to able to change the text on the menu items programmatically.

I'm confused as all the ListActivty / ListView examples ive seen have been building the lists from arrays, cursors, or some other organised data source, with each selection of a list item resulting in the same type of action being performed, say exposing some extra text. What would anyones advice be on how to go about what i'm doing, is listView inapproproate for this, should I just be declaring the whole thing in XML as LinearLayouts with child views and ignoring the listView classes?

Thanks for any help and sorry if this is a really simple question :)

ps im also posting this on the android forum...
rackham
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Oct 06, 2009 10:47 am

Top

Postby wiederke » Thu Oct 29, 2009 1:33 pm

Hi,

I use ListView only for to list a number of icons. I wouldn't use it as a menu.
I would create a layout using XML. Maybe I would create my own MenuItemView, if my MenuItems should look special (3D or something funky).

Remember the Menu button available on most of the phones. The user expects that the menu pops up if he presses the button. Are you sure that the normal option menu of Android isn't enough for your needs?


Bye

Torsten
wiederke
Experienced Developer
Experienced Developer
 
Posts: 72
Joined: Mon Mar 02, 2009 6:46 pm
Location: Germany

Postby rackham » Thu Oct 29, 2009 3:32 pm

I want the first screen off my app to be a menu, much like the contacts view, but with each item having a differnt action. I managed to do it by using ListAdapter.onListItemClick() and just handleing the item selection from the int position thats being passed it which works quite well.

Thanks for the reply!
rackham
Junior Developer
Junior Developer
 
Posts: 15
Joined: Tue Oct 06, 2009 10:47 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests