Added code to stop watch app before starting it to try to improve reliability of app start.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="uk.org.openseizuredetector"
|
||||
android:versionCode="24"
|
||||
android:versionName="2.0.3" >
|
||||
android:versionName="2.0.3a" >
|
||||
|
||||
<uses-sdk android:minSdkVersion="14" />
|
||||
|
||||
|
||||
@@ -401,9 +401,18 @@ public class SdDataSourcePebble extends SdDataSource {
|
||||
* Attempt to start the pebble_sd watch app on the pebble watch.
|
||||
*/
|
||||
public void startWatchApp() {
|
||||
Log.v(TAG, "startWatchApp()");
|
||||
PebbleKit.startAppOnPebble(mContext, SD_UUID);
|
||||
|
||||
Log.v(TAG, "startWatchApp() - closing app first");
|
||||
// first close the watch app if it is running.
|
||||
PebbleKit.closeAppOnPebble(mContext, SD_UUID);
|
||||
// then start it after a 1 second delay.
|
||||
final Handler handler = new Handler();
|
||||
handler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.v(TAG, "startWatchApp() - starting watch app...");
|
||||
PebbleKit.startAppOnPebble(mContext, SD_UUID);
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user