From: kruland2607 Date: Thu, 23 Feb 2012 17:38:17 +0000 (+0000) Subject: Added helper function to correctly implement goHome action. Uses FLAG_ACTIVITY_CLEAR... X-Git-Tag: upstream/12.03~1^2~32 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=c6a1acc5bb7060bcf0de238de5f965e54ef4863d;p=debian%2Fopenrocket Added helper function to correctly implement goHome action. Uses FLAG_ACTIVITY_CLEAR_TOP to remove all activities in between. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@439 180e2498-e6e9-4542-8430-84ac67f01cd8 --- diff --git a/android/src/net/sf/openrocket/android/ActivityHelpers.java b/android/src/net/sf/openrocket/android/ActivityHelpers.java index b2b57382..785852b5 100644 --- a/android/src/net/sf/openrocket/android/ActivityHelpers.java +++ b/android/src/net/sf/openrocket/android/ActivityHelpers.java @@ -7,6 +7,11 @@ import android.content.Intent; public abstract class ActivityHelpers { + public static void goHome( Activity parent ) { + Intent i = new Intent(parent, Main.class); + i.addFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP); + parent.startActivity(i); + } public static void browseMotors( Activity parent ) { Intent i = new Intent(parent, MotorBrowserActivity.class);