I want the user to select which Activity the application should start on. I am trying to开发者_Go百科 avoid tabs because I don't like the layout of tabs, but I have a custom title bar that has three icons on which to select functionality/activity.
I want the user to select which activity the application should start from the beginning with a user preferences.
How can I do this?
After starting the main activity, immediately read from the settings and start the user preferred activity.
I also offer an alterntaive soultion. This is not an exact answer to your question though, but may help you to solve your problem in an elegant way.
- Subclass
TabWidgetand define how the row with tabs is drawn. - Create a layout file for
TabHostwith yourTabWidgetin it. - Subclass TabActivity and set your own layout you've created.
- Read the saved settings and use
setDefaultTabmethod to set the preferred activity.
Voila! You got your own look without losing any functionality of TabActivity. You can read Tab Layout Tutorial for more information on how to do it properly.
What so tough in this. if i have three activity and that i want user to pick one which to start.
加载中,请稍侯......
精彩评论