How to close all activities on android app

by Bruno Lopes » Thu, 19 May 2011 12:45:48 GMT

Sponsored Links
 Hi for all

I'he a android app with 5 activities and i would close all open
activities by pressing a button, for example. How I do it exactly?
What is the better strategy? Somebody can help me?


Re: How to close all activities on android app

by TreKing » Thu, 19 May 2011 23:04:51 GMT


IDK about "best", but discussed here has been the idea of a flag you pass
down the stack in onActivityResult() that tells each parent Activity in the
chain that it should commit suicide and pass the message along.

TreKing <> ; - Chicago
transit tracking app for Android-powered devices


Sponsored Links

Re: How to close all activities on android app

by Bruno Lopes » Fri, 20 May 2011 10:02:36 GMT



Re: How to close all activities on android app

by Simon Jackson » Fri, 20 May 2011 13:41:03 GMT

 make a parent Activity class to derive all your app classes from, and have a 
static Activity head, and a private Activity linkField. Then a static void 
closeListOfActivity() method

This also allows next activity in class jump functionality. Well it would if 
the instance would stay unkilled.

Have the master activity store its bundle in a static, and implement some 
sub bundle tree. I think .class means when the last instance is killed, the 
class has to be removed otherwise static class variables would hold 
references to possibly killed objects. Maybe ??

A static and helper threads checking for keep alive?

Is there a short definitive solution to the arrayofActivity? or a definitive 
answer on static class variable references to Activity instances?

Cheers Jacko


Re: Re: How to close all activities on android app

by Rocky » Fri, 20 May 2011 15:11:35 GMT

 use function movetasktoback().

Thanks & Regards

Rakesh Kumar Jha
Software Developer
Symphony Services Corp (India) Pvt Ltd
(O) +918030274295
(R) +919886336619


Other Threads

1. Android Browser debug question

Hi all

I made a browser app that works nice on iPhone.
No I try to port it to Android.

It's a map library like google maps.

Usage: drag/drop - move the map; doubleclick - zoom in; long press -
zoom out; (+multitouch on iphone)

It works on my legend a little bit, but then it stalls.

Now my question:
How can I debug that?
As far I understand adb only works on the emulator but on the emulater
I don't have touch events.

For normal browsers I use the onerror event and send the bugreport
with AJAX to an errorcollector.

Any idea how to do that on Android?



2. Auto-Process Email Attachments

I have an Android app that I am working on that needs to get regular
data updates.  However, the only way that I will ever be able to
receive the data is via csv files arriving as email attachments.  I
wish that I could use a web service or something else more reliable;
however, this is the constraint that I am working with.

So, how can I build the functionality to monitor all incoming mail and
if I receive a message with a specifically named attachment that has
the expected MIME type, automatically save the attachment so that my
app can process it?


3. Problem google app di Eclair G1

4. Redirect User to HomeScreen after Activity Finishes

5. Working on an Mobile or Embedded Device/System? Tell VDC about your experiences for a chance to WIN!

6. Saving State of Media Player

7. App2sd tanpa flashing ROM