This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41052
    
  43
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: 41052
    
  43
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: 19649
    
  18

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: 41052
    
  43
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
 
Similar Threads
access phonebook entries on nokia phones
J2ME libraries
Can we access the PhoneBook through J2ME
Start JBoss programatically
How to get the number of entries in a HashMap, including the duplicate entries?