how to finish my application?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

how to finish my application?

Postby darolla » Thu Sep 25, 2008 5:20 pm


I'm new to Android. I've got 3 Activities (3 .java and 3 .xml files).

I'm using Intents to switch to the next view.

Intent i = new Intent();
i.setClass(BetsActivity.this, LoginActivity.class);

I've got a context menu with the option to close the application.

But calling finish() just closes my view and switches to the last view (like a back button).

How can I close all my Activities at once?

User avatar
Master Developer
Master Developer
Posts: 273
Joined: Thu Sep 25, 2008 5:16 pm
Location: Dortmund, Germany


Postby michels » Thu Sep 25, 2008 6:40 pm

Hey Marco,

there's no need to do this, cause Android closes applications automatically for the user if memory is low.
Read this and this for more infos :)

The reason is that in Android, you are not in control of your Activity, the operating system is!

finish() closes just one activity, see here.

if you really MUST close your application, read this thread in the android-group.

Hope that helps you
Junior Developer
Junior Developer
Posts: 17
Joined: Wed Sep 24, 2008 12:37 pm
Location: Germany


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests