Moved main Activity to ui sub-package
authorTobias Brunner <tobias@strongswan.org>
Sat, 14 Jul 2012 15:12:07 +0000 (17:12 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 Aug 2012 13:41:04 +0000 (15:41 +0200)
Also force portrait orientation.

src/frontends/android/AndroidManifest.xml
src/frontends/android/src/org/strongswan/android/strongSwanActivity.java [deleted file]
src/frontends/android/src/org/strongswan/android/ui/MainActivity.java [new file with mode: 0644]

index c6f4e14..836ef0f 100644 (file)
         android:icon="@drawable/strongswan"
         android:label="@string/app_name" >
         <activity
-            android:name=".strongSwanActivity"
-            android:label="@string/app_name" >
+            android:name=".ui.MainActivity"
+            android:label="@string/app_name"
+            android:launchMode="singleTop"
+            android:screenOrientation="portrait" >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 
diff --git a/src/frontends/android/src/org/strongswan/android/strongSwanActivity.java b/src/frontends/android/src/org/strongswan/android/strongSwanActivity.java
deleted file mode 100644 (file)
index fabf718..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.strongswan.android;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.net.VpnService;
-import android.os.Bundle;
-
-public class strongSwanActivity extends Activity
-{
-       @Override
-       public void onCreate(Bundle savedInstanceState)
-       {
-               super.onCreate(savedInstanceState);
-               setContentView(R.layout.main);
-               startVpnService();
-       }
-
-       private void startVpnService()
-       {
-               Intent intent = VpnService.prepare(this);
-               if (intent != null)
-               {
-                       startActivityForResult(intent, 0);
-               }
-               else
-               {
-                       onActivityResult(0, RESULT_OK, null);
-               }
-       }
-
-       @Override
-       protected void onActivityResult(int requestCode, int resultCode, Intent data)
-       {
-               if (resultCode == RESULT_OK)
-               {
-                       Intent intent = new Intent(this, CharonVpnService.class);
-                       startService(intent);
-               }
-       }
-}
diff --git a/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java b/src/frontends/android/src/org/strongswan/android/ui/MainActivity.java
new file mode 100644 (file)
index 0000000..ae3a5e3
--- /dev/null
@@ -0,0 +1,40 @@
+package org.strongswan.android.ui;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.VpnService;
+import android.os.Bundle;
+
+public class MainActivity extends Activity
+{
+       @Override
+       public void onCreate(Bundle savedInstanceState)
+       {
+               super.onCreate(savedInstanceState);
+               setContentView(R.layout.main);
+               startVpnService();
+       }
+
+       private void startVpnService()
+       {
+               Intent intent = VpnService.prepare(this);
+               if (intent != null)
+               {
+                       startActivityForResult(intent, 0);
+               }
+               else
+               {
+                       onActivityResult(0, RESULT_OK, null);
+               }
+       }
+
+       @Override
+       protected void onActivityResult(int requestCode, int resultCode, Intent data)
+       {
+               if (resultCode == RESULT_OK)
+               {
+                       Intent intent = new Intent(this, CharonVpnService.class);
+                       startService(intent);
+               }
+       }
+}