mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Fix foreground notification
App crashes on clicking STOP
This commit is contained in:
parent
30f44d8520
commit
37b7b5050e
@ -146,7 +146,6 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
|
|
||||||
startServerButton.setOnClickListener(new View.OnClickListener() {
|
startServerButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override public void onClick(View v) {
|
@Override public void onClick(View v) {
|
||||||
|
|
||||||
//Get the path of ZIMs user has selected
|
//Get the path of ZIMs user has selected
|
||||||
if (!isServerStarted) {
|
if (!isServerStarted) {
|
||||||
getSelectedBooksPath();
|
getSelectedBooksPath();
|
||||||
@ -228,10 +227,11 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
private void bindService() {
|
private void bindService() {
|
||||||
|
|
||||||
bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE);
|
||||||
|
bound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void unbindService() {
|
private void unbindService() {
|
||||||
if (bound) {
|
if (bound && !isServerStarted) {
|
||||||
hotspotService.registerCallBack(null); // unregister
|
hotspotService.registerCallBack(null); // unregister
|
||||||
unbindService(serviceConnection);
|
unbindService(serviceConnection);
|
||||||
bound = false;
|
bound = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user