mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -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();
|
||||
})
|
||||
.show();
|
||||
openDefaultTab();
|
||||
updateTabSwitcherIcon();
|
||||
}
|
||||
|
||||
private void openDefaultTab() {
|
||||
new Handler().postDelayed(() -> {
|
||||
if (webViewList.size() == 0) {
|
||||
newTab(HOME_URL);
|
||||
}
|
||||
}, 1500);
|
||||
updateTabSwitcherIcon();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
private void selectTab(int position) {
|
||||
currentWebViewIndex = position;
|
||||
tabsAdapter.setSelected(position);
|
||||
@ -1157,11 +1160,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
void closeAllTabs() {
|
||||
webViewList.clear();
|
||||
tabsAdapter.notifyDataSetChanged();
|
||||
new Handler().postDelayed(() -> {
|
||||
if (webViewList.size() == 0) {
|
||||
newTab(HOME_URL);
|
||||
}
|
||||
}, 1500);
|
||||
openDefaultTab();
|
||||
updateTabSwitcherIcon();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user