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