views:

35

answers:

2

Hi, i am developing an application where one of my Activity contains a button as "Set as Home Page" . So my problem is that when i will click this button the status will be saved in the shared preference and next time when this application will be opened i want to start this Activity(the Activity which has been set as home page) instead of the default one. Hope you can understand... So how can i do it??? Has anyone gone through this problem????

Thanks in advance....

+1  A: 

You need to have defined static constant unique ID for each of your Activity. You save this ID to shared preferences, and implement on your boot activity's onCreate event a switch based on this stored ID against the static constant ID of your Activity. When you have the right step start the activity, and finish your current activity the booter.

Pentium10
damn you again beat me on the idea :D
Sephy
that's really cool... thanks a lot Pentium10....
Sujit
A: 

You could create a kind of redirection Activity on which your application would start on. Then, put a switch in this activity, with intents sending to each of your activities, and the state of the preference would be the variable to test for the switch. I'm not sure I'm clear but tell me if it's fine for you?

Sephy
Thanks Sephy....
Sujit