On Fri, Sep 9, 2011 at 9:22 AM, Skip Morrow <[email protected]>wrote:

> So, here's my problem. I know you cannot create an activity at runtime. And
> that's exactly what I have described.
>

Doesn't sound like it to me.


> The main menu and each submenu would be a unique activity in Android.
>

No it wouldn't. An Activity in Android represents a single dedicated, well,
*activity*, that a user performs - you've described one: essentially,
browsing a list.


> So how should I redesign my app? Can I have the entire menu and sub-menus
> perform as a single activity?
>

Yes - if the abstract activity that user is performing in all of these
places is "browsing a list", then you could probably get away with one
ListActivity, possibly backed by different Adapters that behave differently
depending on the actual data being shown.


> If so, how will my listview change from the first main menu to show the
> items for the selected menu item?
>

Nothing is stopping you from creating a second instance of the same Activity
that you populate with different data. So the standard Android Activity flow
applies.

Or, if you want to stay in the single Activity instance, look over all the
views available to you and animations. ViewFlipper immediately comes to
mind.


> And will the user be able to go back to the main menu by pressing the back
> arrow?
>

If you use the standard behaviour of starting new instances of the Activity,
yes.
If you want to handle it in a single Activity, look up onBackPressed() and
implement your own logic.


> Also, is there an option for my users to be able to create the
> configuration file on their computer and then somehow upload the
> configuration file to their phone so my app can use it? Ultimately I may
> design a menu creation app, but my users are pretty tech-savvy and writing
> an xml file will not be too difficult for them and will provide them a lot
> of flexibility.
>

They can save the config file to the SD in a known location where your app
looks for it, then you write the code to find it and parse it.

-------------------------------------------------------------------------------------------------
TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to