mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 23:07:26 -04:00
Fixes Access A Deleted File After Closing All Tabs
This commit is contained in:
parent
c34934c8b9
commit
5ce4cc4f6e
@ -782,14 +782,17 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
updateTabSwitcherIcon();
|
updateTabSwitcherIcon();
|
||||||
})
|
})
|
||||||
.show();
|
.show();
|
||||||
|
openDefaultTab();
|
||||||
|
updateTabSwitcherIcon();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openDefaultTab() {
|
||||||
new Handler().postDelayed(() -> {
|
new Handler().postDelayed(() -> {
|
||||||
if (webViewList.size() == 0) {
|
if (webViewList.size() == 0) {
|
||||||
newTab(HOME_URL);
|
newTab(HOME_URL);
|
||||||
}
|
}
|
||||||
}, 1500);
|
}, 100);
|
||||||
updateTabSwitcherIcon();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectTab(int position) {
|
private void selectTab(int position) {
|
||||||
currentWebViewIndex = position;
|
currentWebViewIndex = position;
|
||||||
tabsAdapter.setSelected(position);
|
tabsAdapter.setSelected(position);
|
||||||
@ -1157,11 +1160,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
|||||||
void closeAllTabs() {
|
void closeAllTabs() {
|
||||||
webViewList.clear();
|
webViewList.clear();
|
||||||
tabsAdapter.notifyDataSetChanged();
|
tabsAdapter.notifyDataSetChanged();
|
||||||
new Handler().postDelayed(() -> {
|
openDefaultTab();
|
||||||
if (webViewList.size() == 0) {
|
|
||||||
newTab(HOME_URL);
|
|
||||||
}
|
|
||||||
}, 1500);
|
|
||||||
updateTabSwitcherIcon();
|
updateTabSwitcherIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user