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

hi,

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);
startActivity(i);

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?

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

Top

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
michels
Junior Developer
Junior Developer
 
Posts: 17
Joined: Wed Sep 24, 2008 12:37 pm
Location: Germany

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests