0

I want to create an android app which does one thing (change a setting and save that it did that) and then stops (exits? Stops ? gets destroyed?) before a form is loaded or shown.

Then when I run the app again, I read wether the app has chaged the setting, and then undo's that and then stops (exits? Stops ? gets destroyed?) before a form is loaded or shown.

You can compare it with an existing flashlight app: you click the icon and the flaslight (led) goes on (and no form is shown) and when you click the icon again, the flaslight (led) goes off.

Sounds easy, but I'm not sure I how to do this. Looking at the activity flow (http://developer.android.com/reference/android/app/Activity.html) didn't really help....

Michel
  • 23,085
  • 46
  • 152
  • 242
  • 1
    Did you try executing the action you want in onCreate() of your `Activity` and calling finish() immediately after? onCreate() is executed before any views are shown. – jch000 Jul 24 '15 at 13:06
  • 1
    http://stackoverflow.com/questions/10909683/launch-android-application-without-main-activity-and-start-service-on-launching – Lary Ciminera Jul 24 '15 at 13:08
  • http://stackoverflow.com/questions/3370659/background-application-without-ui , also i think @jchunchar is right, do something in onCreate and finish() (that will stop and destroy app)... – Šime Tokić Jul 24 '15 at 13:13
  • Allright, thanks for the comments. I did not know of finish() that will stop and destroy my app. To be honoust, I only searched for formless app, not for stop and destroy so I did not find the mentioned post – Michel Jul 24 '15 at 13:40

0 Answers0