mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-24 05:04:50 -04:00
Delete readHtml() from MainActivity.java
This commit is contained in:
parent
5f5a312c74
commit
2aa0af3148
@ -955,7 +955,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
openExternalUrl(intentSupportKiwix);
|
openExternalUrl(intentSupportKiwix);
|
||||||
|
|
||||||
case R.id.menu_wifi_hotspot:
|
case R.id.menu_wifi_hotspot:
|
||||||
if (readHtmlPage()) {
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
toggleHotspot();
|
toggleHotspot();
|
||||||
} else {
|
} else {
|
||||||
@ -966,7 +965,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
startHotspotDialog();
|
startHotspotDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -974,28 +972,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean readHtmlPage() {
|
|
||||||
String url =
|
|
||||||
Uri.parse(ZimContentProvider.CONTENT_URI + ZimContentProvider.getMainPage()).toString();
|
|
||||||
Uri uri = Uri.parse(url);
|
|
||||||
try {
|
|
||||||
InputStream in = getContentResolver().openInputStream(uri);
|
|
||||||
OutputStream out =
|
|
||||||
new FileOutputStream(new File(MAIN_PAGE_STORAGE_PATH));
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((len = in.read(buf)) > 0) {
|
|
||||||
out.write(buf, 0, len);
|
|
||||||
}
|
|
||||||
out.close();
|
|
||||||
in.close();
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.v("DANG", e.toString());
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Dialog to take user confirmation before deleting all notes */
|
/** Dialog to take user confirmation before deleting all notes */
|
||||||
private void showClearAllNotesDialog() {
|
private void showClearAllNotesDialog() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user