aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
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: 42911
    
  68
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.
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: 42911
    
  68
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: 19783
    
  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: 42911
    
  68
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/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is this propel way shutdown app