• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to call a Process before launching an Activity

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 633
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your valuable suggestions guys. If any problem i will get back to you guys.
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic