Fixes Access A Deleted File After Closing All Tabs

This commit is contained in:
Adeel Zafar 2019-02-27 20:04:39 +05:00 committed by Isaac Hutt
parent c34934c8b9
commit 5ce4cc4f6e

View File

@ -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();
}