Rework the loading workflow to be more natural and fix some nasty bugs. Make the...
[debian/openrocket] / android / src / net / sf / openrocket / android / ActivityHelpers.java
index 785852b5debdd1eb46962e24d2358e764e125b41..02e920e4c24d9246179f578d62c6a28ff192e1de 100644 (file)
@@ -4,12 +4,14 @@ import net.sf.openrocket.android.motor.MotorBrowserActivity;
 import net.sf.openrocket.android.thrustcurve.TCQueryActivity;\r
 import android.app.Activity;\r
 import android.content.Intent;\r
+import android.net.Uri;\r
+import android.support.v4.app.FragmentActivity;\r
 \r
 public abstract class ActivityHelpers {\r
 \r
        public static void goHome( Activity parent ) {\r
                Intent i = new Intent(parent, Main.class);\r
-               i.addFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP);\r
+               i.addFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP + Intent.FLAG_ACTIVITY_NEW_TASK );\r
                parent.startActivity(i);\r
        }\r
        \r
@@ -28,4 +30,16 @@ public abstract class ActivityHelpers {
                parent.startActivityForResult(i, requestCode);\r
        }\r
 \r
+       public static void donate( Activity parent ) {\r
+               String url = "http://sourceforge.net/donate/index.php?group_id=260357";\r
+               Intent intent = new Intent(Intent.ACTION_VIEW);\r
+               intent.setData( Uri.parse(url) );\r
+               parent.startActivity(intent);\r
+       }\r
+       \r
+       public static void showAbout( FragmentActivity parent ) {\r
+               AboutDialogFragment frag = AboutDialogFragment.newInstance();\r
+               frag.show(parent.getSupportFragmentManager(), "about");\r
+       }\r
+\r
 }\r