This commit is contained in:
Harald Hoyer 2017-04-27 15:21:10 +02:00
parent 39af7e815e
commit 5092d120a7
2 changed files with 9 additions and 1 deletions

View file

@ -126,7 +126,7 @@ public class BluetoothChatFragment extends Fragment {
mChatService.stopBT();
}
Log.d(TAG, "onDestroy()");
doUnbindService();
super.onDestroy();
}

View file

@ -60,6 +60,7 @@ public class MainActivity extends FragmentActivity {
transaction.commit();
}
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
ComponentName componentName = startService(new Intent(this, BluetoothChatService.class));
if (componentName == null)
Log.e(TAG, "componentName == null");
@ -119,4 +120,11 @@ public class MainActivity extends FragmentActivity {
Log.i(TAG, "Ready");
}
*/
@Override
protected void onDestroy() {
stopService(new Intent(this, BluetoothChatService.class));
super.onDestroy();
}
}