mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
do not kill library service too often
This commit is contained in:
parent
2d91e8d7b6
commit
32e122113a
2 changed files with 8 additions and 11 deletions
|
@ -183,6 +183,7 @@ public final class FBReader extends Activity {
|
|||
if (myFBReaderApp == null) {
|
||||
myFBReaderApp = new FBReaderApp(new BookCollectionShadow());
|
||||
}
|
||||
getCollection().bindToService(this, null);
|
||||
myBook = null;
|
||||
|
||||
final ZLAndroidApplication androidApplication = (ZLAndroidApplication)getApplication();
|
||||
|
@ -454,10 +455,15 @@ public final class FBReader extends Activity {
|
|||
protected void onStop() {
|
||||
ApiServerImplementation.sendEvent(this, ApiListener.EVENT_READ_MODE_CLOSED);
|
||||
PopupPanel.removeAllWindows(myFBReaderApp, this);
|
||||
getCollection().unbind();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
getCollection().unbind();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLowMemory() {
|
||||
myFBReaderApp.onWindowClosing();
|
||||
|
|
|
@ -68,11 +68,7 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
|
||||
getListView().setTextFilterEnabled(true);
|
||||
getListView().setOnCreateContextMenuListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
((BookCollectionShadow)myRootTree.Collection).bindToService(this, new Runnable() {
|
||||
public void run() {
|
||||
setProgressBarIndeterminateVisibility(!myRootTree.Collection.status().IsCompleted);
|
||||
|
@ -102,15 +98,10 @@ public class LibraryActivity extends TreeActivity<LibraryTree> implements MenuIt
|
|||
return key != null ? myRootTree.getLibraryTree(key) : myRootTree;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
((BookCollectionShadow)myRootTree.Collection).unbind();
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
myRootTree.Collection.removeListener(this);
|
||||
((BookCollectionShadow)myRootTree.Collection).unbind();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue