• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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: 43076
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.
 
My pie came with a little toothpic holding up this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic