wood burning stoves 2.0*
The moose likes Android and the fly likes is this propel way shutdown app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Mobile » Android
Bookmark "is this propel way shutdown app" Watch "is this propel way shutdown app" New topic
Author

is this propel way shutdown app

Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
is this propel way shutdown app... it seems not, go back one step and after return button pressed on keyboard, and press again for repeated 3 = 5 total times, this shutdown app...

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
Yes, it is. Not sure what the mention of going back and hitting return repeatedly is all about; it certainly doesn't shut down any apps.


Ping & DNS - my free Android networking tools app
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
If press to run this line does not shut downs immediately but needed press/run line, for 3-4 times...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
finish quits the current activity, not the application. If an application has opened several activities, then you need to call finish on all of them.
Leonidas Savvides
Ranch Hand

Joined: Jan 31, 2010
Posts: 403
how shutdown an app independently how many activities ran previously?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

I haven't done any Android development yet, but won't the app close when all activities are closed? IF so, all you need to do to close the app immediately is finish all activities, not just the current one. If the existing activities are not retrievable using the API then just store them all yourself.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42047
    
  64
It depends on how the application is structured. An Android app can contain components other than activities (like services, wallpapers, content providers, broadcast receivers). Some of those might still be running even if all activities have been terminated. If the app consists only of activities, then terminating those will leave no part of the app running.

You could use a custom Application subclass to keep track of all open activities: http://trace.adityalesmana.com/2010/08/declare-global-variable-in-android-via-android-app-application/
 
GeeCON Prague 2014
 
subject: is this propel way shutdown app