• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call a Process before launching an Activity

 
Gokul Kesavalu
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having an application which comprises of auto-sign on feature. Before launching the main activity i need to check whether the user activated the feature or not. Please tell me how to do this. Also please help me how to save application private data in device with an example. thanks in advance.

With Regards
Gokul.K
 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gokul Kesavalu wrote:Hi,
Before launching the main activity i need to check whether the user activated the feature or not.


It is not possible to check it before launching main activity. Because main activity is your entry point in your application.

To save private data you can use file, database. And if you want to access this data in other application then use ContentProvider. If you google on this you will get lot of tutorials.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before launching the main activity i need to check whether the user activated the feature or not.

What do you hope to achieve by running code before an Activity is created? Why can't this be part of the Activity's onCreate method?

Also please help me how to save application private data in device with an example.

http://www.ibm.com/developerworks/xml/library/x-androidstorage/index.html
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gokul Kesavalu wrote:Hi,
I am having an application which comprises of auto-sign on feature. Before launching the main activity i need to check whether the user activated the feature or not. Please tell me how to do this. Also please help me how to save application private data in device with an example. thanks in advance.

With Regards
Gokul.K

Sounds to me like you could use Preferences to flag whether user wants auto-sign on or not. In onCreate() of your activity, check the value of this flag and initiate appropriate code flow.
 
Gokul Kesavalu
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your valuable suggestions guys. If any problem i will get back to you guys.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic