mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Get file path of selected books
This commit is contained in:
parent
d1b5536173
commit
9c175bdbaa
@ -81,11 +81,12 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
private Intent serviceIntent;
|
private Intent serviceIntent;
|
||||||
private Task<LocationSettingsResponse> task;
|
private Task<LocationSettingsResponse> task;
|
||||||
|
|
||||||
private BooksOnDiskAdapter booksAdapter;
|
BooksOnDiskAdapter booksAdapter;
|
||||||
HotspotService hotspotService;
|
HotspotService hotspotService;
|
||||||
String ip;
|
String ip;
|
||||||
boolean bound;
|
boolean bound;
|
||||||
ServiceConnection serviceConnection;
|
ServiceConnection serviceConnection;
|
||||||
|
ArrayList<String> selectedBooksPath = new ArrayList<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@ -147,6 +148,8 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
|
|
||||||
//Get File Path of All The ZIMs using booksAdapter
|
//Get File Path of All The ZIMs using booksAdapter
|
||||||
|
|
||||||
|
getSelectedBooksPath();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
toggleHotspot();
|
toggleHotspot();
|
||||||
} else {
|
} else {
|
||||||
@ -165,6 +168,19 @@ public class ZimHostActivity extends BaseActivity implements
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getSelectedBooksPath() {
|
||||||
|
BooksOnDiskListItem.BookOnDisk bookOnDisk;
|
||||||
|
|
||||||
|
for (BooksOnDiskListItem item : booksAdapter.getItems()) {
|
||||||
|
if (item.isSelected()) {
|
||||||
|
bookOnDisk = (BooksOnDiskListItem.BookOnDisk) item;
|
||||||
|
File file = bookOnDisk.getFile();
|
||||||
|
selectedBooksPath.add(file.getAbsolutePath());
|
||||||
|
Log.v(TAG, "ZIM PATH : " + file.getAbsolutePath());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void open(BooksOnDiskListItem.BookOnDisk bookOnDisk) {
|
public void open(BooksOnDiskListItem.BookOnDisk bookOnDisk) {
|
||||||
File file = bookOnDisk.getFile();
|
File file = bookOnDisk.getFile();
|
||||||
Intent zimFile = new Intent(this, MainActivity.class);
|
Intent zimFile = new Intent(this, MainActivity.class);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user