Skip to content

Commit

Permalink
Update Contact_us.java
Browse files Browse the repository at this point in the history
fixed Interface
  • Loading branch information
banditAmit committed Aug 5, 2024
1 parent ffc8c11 commit 33934dd
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 33934dd

Please sign in to comment.