Almost got Bluetooth syncing working, still have crash att app exit

This commit is contained in:
Ziver Koc 2015-01-30 17:16:31 +01:00
parent bb24b03557
commit 84b679a7cc
7 changed files with 92 additions and 51 deletions

View file

@ -287,11 +287,7 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
@Override
public void onBackPressed() {
if (backButtonPressed) {
if(executor != null){
log.info("Terminating executor");
executor.terminate();
executor.reset();
}
// Close the App
super.onBackPressed();
return;
}
@ -306,7 +302,15 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
}
}, 2000);
}
@Override
protected void onDestroy() {
if(executor != null){
executor.terminate();
executor.reset();
executor = null;
}
super.onDestroy();
}
public static UeControlExecutor getExecutor() {
return executor;