summaryrefslogtreecommitdiffstats
path: root/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java')
-rw-r--r--android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
index 4c5bc576b..c909210f2 100644
--- a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
+++ b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java
@@ -28,15 +28,19 @@ public class SubsurfaceMobileActivity extends QtActivity
public static boolean isInitialized;
private static final String TAG = "subsurfacedivelog.mobile";
public static native void setDeviceString(String deviceString);
+ private static Context appContext;
// we need to provide two endpoints:
// onNewIntent if we receive an Intent while running
// onCreate if we were started by an Intent
@Override
- public void onCreate(Bundle savedInstanceState) {
+ public void onCreate(Bundle savedInstanceState)
+ {
Log.i(TAG + " onCreate", "onCreate SubsurfaceMobileActivity");
super.onCreate(savedInstanceState);
+ appContext = getApplicationContext();
+
// now we're checking if the App was started from another Android App via Intent
Intent theIntent = getIntent();
if (theIntent != null) {
@@ -50,7 +54,8 @@ public class SubsurfaceMobileActivity extends QtActivity
// if we are opened from other apps:
@Override
- public void onNewIntent(Intent intent) {
+ public void onNewIntent(Intent intent)
+ {
Log.i(TAG + " onNewIntent", intent.getAction());
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
if (device == null) {
@@ -68,7 +73,8 @@ public class SubsurfaceMobileActivity extends QtActivity
}
} // onNewIntent
- public void checkPendingIntents() {
+ public void checkPendingIntents()
+ {
isInitialized = true;
if (isIntentPending) {
isIntentPending = false;
@@ -80,7 +86,8 @@ public class SubsurfaceMobileActivity extends QtActivity
} // checkPendingIntents
- private void processIntent() {
+ private void processIntent()
+ {
Intent intent = getIntent();
if (intent == null) {
Log.i(TAG + " processIntent", "intent is null");
@@ -95,4 +102,10 @@ public class SubsurfaceMobileActivity extends QtActivity
Log.i(TAG + " processIntent device name", device.getDeviceName());
setDeviceString(device.toString());
} // processIntent
+
+
+ public static Context getAppContext()
+ {
+ return appContext;
+ }
}