问题
Hey, My (first) app needs to give the user the option to choose which region he is in (US,Europe,Asia) etc. I think I'm ok with the menu side of it, but I'm not sure how to get the app to automatically route the user to the correct activity, depending on his choice.
So the question is, do I use an activity or an application to read the previously stored region and route them accordingly? Does anyone have any sample code that I can look at? Thanks
回答1:
Maybe you could commit it to a sharedpreference value. I think its more or less the cleanest way to do it.
take a look at http://developer.android.com/guide/topics/data/data-storage.html#pref If you need more help just post a reply k? good luck with ur codes :)
回答2:
You could have a menu/activity that gets the region and then create a new Intent for the appropriate activity to start.
来源:https://stackoverflow.com/questions/5939591/how-to-route-the-user-to-the-correct-activity