How to route the user to the correct activity?

爱⌒轻易说出口 提交于 2019-12-12 05:37:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!