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(); mChatService.stopBT();
} }
Log.d(TAG, "onDestroy()"); Log.d(TAG, "onDestroy()");
doUnbindService();
super.onDestroy(); super.onDestroy();
} }

View file

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