Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
1. fix bugs by preesing on back
2. close app when loaded url isn't allowed
  • Loading branch information
AshiVered committed Jul 25, 2024
1 parent c595493 commit 2cb49f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app/src/main/java/aiv/ashivered/safebrowser/LoadUrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void blockString() {
public void onBackPressed () {
if (mWebView.canGoBack()) {
mWebView.goBack();
} else if (mWebView.canGoBack()) {
} else {
super.onBackPressed();
}
}
Expand Down Expand Up @@ -135,8 +135,9 @@ protected void onCreate(Bundle savedInstanceState) {
mWebView.loadUrl(data.toString());
} else {
blockString();
Intent goMain = new Intent(this, MainActivity.class);
startActivity(goMain);
/* Intent goMain = new Intent(this, MainActivity.class);
startActivity(goMain); */
finish();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void blockString() {
public void onBackPressed () {
if (mWebView.canGoBack()) {
mWebView.goBack();
} else if (mWebView.canGoBack()) {
} else {
super.onBackPressed();
}
}
Expand Down

0 comments on commit 2cb49f5

Please sign in to comment.