v2.0.6 - stop watch app before starting to improve reliability

This commit is contained in:
Graham Jones
2016-07-19 22:35:25 +01:00
parent 70f251dff6
commit 354f9c6fa2
3 changed files with 26 additions and 15 deletions

View File

@@ -469,9 +469,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);
}
/**