1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 10:19:33 +02:00

string list as book path (only first element can be set from preferences)

This commit is contained in:
Nikolay Pultsin 2013-10-12 11:16:23 +01:00
parent 56d7de4620
commit 9b5718e104
7 changed files with 82 additions and 15 deletions

View file

@ -19,6 +19,9 @@
package org.geometerplus.android.fbreader.crash;
import java.util.LinkedList;
import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
@ -56,7 +59,12 @@ public class FixBooksDirectoryActivity extends Activity {
okButton.setText(buttonResource.getResource("ok").getValue());
okButton.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
Paths.BooksDirectoryOption().setValue(directoryView.getText().toString());
final List<String> bookPath =
new LinkedList<String>(Paths.BookPathOption().getValue());
final String newDirectory = directoryView.getText().toString();
bookPath.remove(newDirectory);
bookPath.add(0, newDirectory);
Paths.BookPathOption().setValue(bookPath);
startActivity(new Intent(FixBooksDirectoryActivity.this, FBReader.class));
finish();
}