diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2018-08-09 07:14:56 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-11 11:14:22 -0700 |
commit | fd58441b085a55df6c6da75131eb75fb0a65a0a1 (patch) | |
tree | 2d9911a3f8bcdc1af963fe7b30a07dfc63ef85d5 /android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java | |
parent | fbf94d4a7bda22e0b15b8705ed64968c2a57d9dc (diff) | |
download | subsurface-fd58441b085a55df6c6da75131eb75fb0a65a0a1.tar.gz |
Android: only handle Intents after the app is initialized
The old code happened to work because this function only got called if
the app was already running, but the correct thing to do is to always
wait until we have first called back from C++ code, indicating that the
app is indeed fully initialized.
This way we only process the Intent in one place in the Java code.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java')
-rw-r--r-- | android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java index 432785f3c..881016285 100644 --- a/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java +++ b/android-mobile/src/org/subsurfacedivelog/mobile/SubsurfaceMobileActivity.java @@ -53,13 +53,7 @@ public class SubsurfaceMobileActivity extends QtActivity public void onNewIntent(Intent intent) { Log.i(TAG + " onNewIntent", intent.getAction()); UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); - Log.i(TAG + " onNewIntent device name", device.getDeviceName()); - // if (Build.VERSION.SDK_INT > 20) { - // Log.i(TAG + " onNewIntent manufacturer name", device.getManufacturerName()); - // Log.i(TAG + " onNewIntent product name", device.getProductName()); - // } Log.i(TAG + " onNewIntent toString", device.toString()); - setDeviceString(device.toString()); super.onNewIntent(intent); setIntent(intent); // Intent will be processed, if all is initialized and Qt / QML can handle the event @@ -88,10 +82,6 @@ public class SubsurfaceMobileActivity extends QtActivity Log.i(TAG + " processIntent", intent.getAction()); UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); Log.i(TAG + " processIntent device name", device.getDeviceName()); - // if (Build.VERSION.SDK_INT > 20) { - // Log.i(TAG + " processIntent manufacturer name", device.getManufacturerName()); - // Log.i(TAG + " processIntent product name", device.getProductName()); - // } - Log.i(TAG + " processIntent toString", device.toString()); + setDeviceString(device.toString()); } // processIntent } |