Fix foreground notification

App crashes on clicking STOP
This commit is contained in:
Adeel Zafar 2019-08-15 03:26:45 +05:00
parent 30f44d8520
commit 37b7b5050e

View File

@ -146,7 +146,6 @@ public class ZimHostActivity extends BaseActivity implements
startServerButton.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View v) {
//Get the path of ZIMs user has selected
if (!isServerStarted) {
getSelectedBooksPath();
@ -228,10 +227,11 @@ public class ZimHostActivity extends BaseActivity implements
private void bindService() {
bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
bound = true;
}
private void unbindService() {
if (bound) {
if (bound && !isServerStarted) {
hotspotService.registerCallBack(null); // unregister
unbindService(serviceConnection);
bound = false;