mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
code cleanup
This commit is contained in:
parent
3940ec8589
commit
fdf80bd6a4
1 changed files with 8 additions and 17 deletions
|
@ -47,26 +47,10 @@ import org.geometerplus.android.fbreader.FBReader;
|
|||
import org.geometerplus.android.fbreader.libraryService.BookCollectionShadow;
|
||||
|
||||
public class PreferenceActivity extends ZLPreferenceActivity {
|
||||
private BookCollectionShadow myCollection = new BookCollectionShadow();
|
||||
|
||||
public PreferenceActivity() {
|
||||
super("Preferences");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
||||
myCollection.bindToService(this, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
myCollection.unbind();
|
||||
|
||||
super.onStop();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init(Intent intent) {
|
||||
setResult(FBReader.RESULT_REPAINT);
|
||||
|
@ -93,7 +77,14 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
) {
|
||||
protected void setValue(String value) {
|
||||
super.setValue(value);
|
||||
myCollection.reset(false);
|
||||
|
||||
final BookCollectionShadow collection = new BookCollectionShadow();
|
||||
collection.bindToService(PreferenceActivity.this, new Runnable() {
|
||||
public void run() {
|
||||
collection.reset(false);
|
||||
collection.unbind();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
directoriesScreen.addPreference(new ZLStringListOptionPreference(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue