Skip to content

Commit

Permalink
Merge pull request #72 from payatu/banditAmit-patch-1
Browse files Browse the repository at this point in the history
Update Contact_us.java
  • Loading branch information
banditAmit authored Aug 5, 2024
2 parents ffc8c11 + 33934dd commit 57904fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/src/main/java/com/BugBazaar/ui/Contact_us.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected void onCreate(Bundle savedInstanceState) {
toolbarTitle.setText("Contact us");

WebView webView = findViewById(R.id.webview2);
webView.setWebViewClient(new WebViewClient());
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().getAllowFileAccessFromFileURLs();
Expand All @@ -53,7 +53,7 @@ protected void onCreate(Bundle savedInstanceState) {

webView.loadUrl(String.valueOf(uri));
}

}
class MyWebViewClient extends WebViewClient {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
Expand All @@ -72,7 +72,7 @@ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceReque
// Read the content of the cache file
File cacheDir = getCacheDir();
File cacheFile = new File(cacheDir, uri.getLastPathSegment());
// Log.d("testcachelastsegment", uri.getLastPathSegment());
// Log.d("testcachelastsegment", uri.getLastPathSegment());
//Log.d("testcachefile", String.valueOf(cacheFile));
if (cacheFile.exists()) {
try {
Expand Down Expand Up @@ -138,9 +138,9 @@ public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceReque


}
}

//Code to handle backbutton
public void onBackButtonClick(View view) {
onBackPressed(); // Navigate back to the previous activity
}
}
}

0 comments on commit 57904fd

Please sign in to comment.