Can you give a little more detail about how the workflow of your application
is supposed to work?  We might be able to give some better suggestions on
how best implement it.

Seems to me like you have two different options, but they are drastically
different and the one you would want to choose would depend on how your app
works:

   1. Switch to a new Activity.  You do this by creating a new intent and
   passing in the class of the new Activity in the constructor.  You then call
   startActivity from the current context (most likely an Activity) and that
   will launch the new Activity.  However, you have to set up your activities
   with the correct behavior when you do this... e.g. when you go to the new
   activity should it replace the current one on the Activity stack or should
   the user go back to it if they hit the back button? See
   http://developer.android.com/guide/topics/intents/intents-filters.htmlfor
more info on Intents...
   2. Use some mechanism to store a setting (most likely using
   SharedPreferences but there are other methods available as well) and read
   that setting in the onCreate method of your activity to determine which
   layout to load.  This would require the user to exit out of the application
   and restart it to see the new layout though... (but I have seen this
   mechanism used in quite a few apps, just put a note or something saying that
   changing the setting requires a restart). See
   http://developer.android.com/guide/topics/data/data-storage.html for more
   info on storing data...

I'm sure there are many other ways to go about this but these seem like the
most intuitive to me off the top of my head.  Again, if you were to walk us
through the entire user experience we might be able to give some more
precise advice/feedback...

Hope that helps somewhat,
Justin


----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Mon, May 24, 2010 at 5:48 PM, [email protected] <
[email protected]> wrote:

> How would you do it via Switching the Activity
>
> On May 24, 7:34 pm, Justin Anderson <[email protected]> wrote:
> > Hmmm... that may be possible but I'm not sure exactly how to do it.  I
> know
> > there have been lots of people who have tried but I'm not sure if they
> have
> > come up with a solution...
> >
> > If you can't figure it out you can always set it up so that the layout
> > changes requires a restart of your app...  You can then save a setting
> and
> > use that at startup to determine which layout to load.
> >
> > On May 24, 2010 5:18 PM, "[email protected]" <
> >
> > [email protected]> wrote:
> >
> > On May 24, 7:02 pm, Justin Anderson <[email protected]> wrote:
> >
> > > Typically you would want to...
> > > On Mon, May 24, 2010 at 4:16 PM, [email protected] <
> >
> > > [email protected]> wrote:
> >
> > > > On May 24, 5:15 pm, TreKing <[email protected]...
> > > > > [email protected]<android-beginners%[email protected]><android-beginners%2Bunsubscr
> [email protected]><android-beginners%2Bunsubscr
> >
> > [email protected]>
> >
> > > > > For more options, visit this group athttp://
> > > > groups.google.com/group/android-beginners?hl=...
> > > > [email protected]<android-beginners%[email protected]><android-beginners%2Bunsubscr
> [email protected]><android-beginners%2Bunsubscr
> >
> > [email protected]>
> >
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-beginners?hl=en
> >
> > ...
> >
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Beginner...
> >
> > Im trying to click an item on the list that will load a new layout,
> > but when I use setContentView it errors out
> >
> > --
> >
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group....
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
> >
> > NEW! Try asking and tagging your question on Stack Overflow athttp://
> stackoverflow.com/questions/tagged/android
> >
> > To unsubscribe from this group, send email to
> > [email protected]<android-beginners%[email protected]>
> > For more options, visit this group athttp://
> groups.google.com/group/android-beginners?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to