How To Make A WebView Link In Fragment Open An Activity? - android

I have a webview in a fragment, the webview has multiple links. I want when the user clicks on one of those links, for example, a Readmore link it opens the in-app browser I created (BrowserActivity). How can I achieve this?
BrowserActivity.java
public class BrowserActivity extends AppCompatActivity {
private String Url ;
private WebView Tecwebview;
private ProgressBar progressBar;
ImageButton back, forward, stop, refresh, homeButton;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_browser);
back = (ImageButton) findViewById(R.id.back_arrow);
forward = (ImageButton) findViewById(R.id.forward_arrow);
stop = (ImageButton) findViewById(R.id.stop);
refresh = (ImageButton) findViewById(R.id.refresh);
homeButton = (ImageButton) findViewById(R.id.home);
progressBar = (ProgressBar) findViewById(R.id.probar);
progressBar.setMax(100);
Tecwebview = (WebView) findViewById(R.id.tecwebview);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Tecwebview.loadUrl(Url);
if (savedInstanceState != null) {
Tecwebview.restoreState(savedInstanceState);
} else {
Tecwebview.getSettings().setJavaScriptEnabled(true);
Tecwebview.getSettings().setUseWideViewPort(true);
Tecwebview.getSettings().setLoadWithOverviewMode(true);
Tecwebview.getSettings().setSupportZoom(true);
Tecwebview.getSettings().setSupportMultipleWindows(true);
Tecwebview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
Tecwebview.setWebChromeClient(new WebChromeClient() {
#Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
progressBar.setProgress(newProgress);
if (newProgress < 100 && progressBar.getVisibility() == ProgressBar.GONE) {
progressBar.setVisibility(ProgressBar.VISIBLE);
}
if (newProgress == 100) {
progressBar.setVisibility(ProgressBar.GONE);
} else {
progressBar.setVisibility(ProgressBar.VISIBLE);
}
}
});
}
Tecwebview.setWebViewClient(new MyWebViewClient());
back.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (Tecwebview.canGoBack()) {
Tecwebview.goBack();
}
}
});
forward.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
if (Tecwebview.canGoForward()) {
Tecwebview.goForward();
}
}
});
stop.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Tecwebview.stopLoading();
}
});
refresh.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Tecwebview.reload();
}
});
homeButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Tecwebview.loadUrl("https://google.com");
}
});
}
private class MyWebViewClient extends WebViewClient {
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
progressBar.setVisibility(View.VISIBLE);
super.onPageStarted(view, url, favicon);
}
#Override
public void onPageFinished(WebView view, String url) {
progressBar.setVisibility(View.GONE);
super.onPageFinished(view, url);
}
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.browser, menu);
return true;
}
Fragment
public class NewsFragment extends Fragment {
private WebView Tecwebview;
public NewsFragment() {
}
LinearLayout Weblinearlayout;
SwipeRefreshLayout Webswipelayout;
ProgressBar progressBar;
String url = "http://someweb.com/news/";
#Nullable
#Override
public View onCreateView(#NonNull LayoutInflater inflater, #Nullable ViewGroup container, #Nullable
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_home, container, false);
Tecwebview = (WebView) v.findViewById(R.id.tecwebview);
progressBar = (ProgressBar) v.findViewById(R.id.probar);
Weblinearlayout = v.findViewById(R.id.layout);
Webswipelayout = v.findViewById(R.id.swipe);
progressBar.setMax(100);
WebSettings Websettings = Tecwebview.getSettings();
Websettings.setJavaScriptEnabled(true);
Tecwebview.setWebViewClient(new WebViewClient());
Tecwebview.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
progressBar.setProgress(progress);
if (progress < 100 && progressBar.getVisibility() == ProgressBar.GONE) {
progressBar.setVisibility(ProgressBar.VISIBLE);
Tecwebview.setVisibility(View.GONE);
}
if (progress == 100) {
progressBar.setVisibility(ProgressBar.GONE);
Tecwebview.setVisibility(View.VISIBLE);
}
}
});
Webswipelayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
#Override
public void onRefresh() {
Tecwebview.reload();
LoadWeb();
}
});
Tecwebview.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() {
#Override
public void onScrollChanged() {
if (Tecwebview.getScrollY()==0){
Webswipelayout.setEnabled(true);
} else {
Webswipelayout.setEnabled(false);
}
}
});
Tecwebview.setWebViewClient(new HomeFragment.MyCustomWebViewClient(){
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Weblinearlayout.setVisibility(View.VISIBLE);
super.onPageStarted(view, url, favicon);
}
#Override
public void onPageFinished(WebView view, String url) {
Weblinearlayout.setVisibility(View.GONE);
Webswipelayout.setRefreshing(false);
super.onPageFinished(view, url);
}
});
LoadWeb();
// This code if for the on back press within webview
Tecwebview.canGoBack();
Tecwebview.setOnKeyListener(new View.OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK
&& event.getAction() == MotionEvent.ACTION_UP
&& Tecwebview.canGoBack()) {
Tecwebview.goBack();
return true;
}
return false;
}
});
return v;
}
public void LoadWeb() {
Tecwebview.loadUrl(url);
Webswipelayout.setRefreshing(true);
}
This is for browser activity to make the links in browser activity webview only opens in the webview
public class MyWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
CookieManager.getInstance().setAcceptCookie(true);
return true;
}

According to my understanding you have a url e.g, www.xyz.com and you want to load your Activity when the user clicks on it.
If that is true then try following code but change the value of targeUrl to your link address and also launch the activity in the area where I have wrote comment...
Tecwebview.setWebViewClient(new WebViewClient() {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
String targetUrl = "https//www.somelinksaddress.com/me/you";
if (targetUrl.equals(url)) {
// Start your activity here
} else {
view.loadUrl(url);
}
return true;
}
});

Related

Android Studio Webview login cache

my webview app opens a website that i need to login. but if i login and destroy the app, i need to login again. i want to cache login data and no need to login again until i log out. how can i make the webview app like holding caches? if user dont logout, app must to stay logged in. thanks for helping
here is my code:
WebView webid;
String newString;
ImageView loading;
AnimationDrawable animation;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webid = (WebView) findViewById(R.id.webid);
loading = (ImageView)findViewById(R.id.loader);
animation = (AnimationDrawable) loading.getDrawable();
WebSettings webSettings = webid.getSettings();
webSettings.setJavaScriptEnabled(true);
webid.loadUrl("https://ios.mavicell.com");
webid.setWebViewClient(new WebViewClient(){
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
loading.setVisibility(View.VISIBLE);
animation.start();
}
#Override
public void onPageCommitVisible(WebView view, String url) {
super.onPageCommitVisible(view,url);
loading.setVisibility(View.INVISIBLE);
animation.stop();
}
#Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
loading.setVisibility(View.INVISIBLE);
animation.stop();
}
});
if (savedInstanceState == null) {
Bundle extras = getIntent().getExtras();
if(extras == null) {
newString= null;
} else {
newString= extras.getString("urlayar");
}
} else {
newString= (String) savedInstanceState.getSerializable("urlayar");
}
if (newString != null) {
webid.loadUrl(newString);
webid.getSettings().setJavaScriptEnabled(true);
webid.setWebViewClient(new WebViewClient(){
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
loading.setVisibility(View.VISIBLE);
animation.start();
}
#Override
public void onPageCommitVisible(WebView view, String url) {
super.onPageCommitVisible(view,url);
loading.setVisibility(View.INVISIBLE);
animation.stop();
}
#Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
loading.setVisibility(View.INVISIBLE);
animation.stop();
}
});
}
else {
}
// Logging set to help debug issues, remove before releasing your app.
OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.NONE);
// OneSignal Initialization
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
}
#Override
public boolean onKeyDown(int keyCode, #NonNull KeyEvent event){
if(event.getAction() == KeyEvent.ACTION_DOWN){
if (keyCode == KeyEvent.KEYCODE_BACK) {
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setTitle("Mavicell");
builder.setMessage("Çıkmak istediğinize emin misiniz?");
builder.setNegativeButton("Hayır", null);
builder.setPositiveButton("Evet", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialogInterface, int i) {
finish();
}
});
builder.show();
return true;
}
}
return super.onKeyDown(keyCode, event);
}
This below line should do your work
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT)

How to implement "tel:" url in Webview

I'm building an Webview app which displays my website. My website contains clickable mobile number, I need to open dialer when user clicks it.
I've gone through this question.
Since I'm new to Android development I don't know exactly where to paste that code.
Here Is my Mainactivity.java code
public class MainActivity extends AppCompatActivity {
private WebView webView;
private ProgressBar mProgressBar;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
webView= findViewById(R.id.web);
mProgressBar= findViewById(R.id.progressbar);
mProgressBar.setMax(100);
webView.loadUrl("https://");
webView.getSettings().setJavaScriptEnabled(true);
webView.setWebViewClient(new WebViewClient());
webView.setWebChromeClient(new WebChromeClient(){
#Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
mProgressBar.setProgress(newProgress);
}
#Override
public void onReceivedTitle(WebView view, String title) {
super.onReceivedTitle(view, title);
}
#Override
public void onReceivedIcon(WebView view, Bitmap icon) {
super.onReceivedIcon(view, icon);
}
});
}
#Override
public void onBackPressed(){
if (webView.canGoBack()) {
webView.goBack();
}else {
finish();
}
}}
You need to Override the shouldOverrideUrlLoading() method in setWebViewClient()
SAMPLE CODE
webView.setWebChromeClient(new WebChromeClient() {
public void onProgressChanged(WebView view, int progress) {
progressBar.setProgress(progress);
}
});
webView.setWebViewClient(new WebViewClient() {
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
}
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url.contains("tel:"))
{
Intent intent = new Intent(Intent.ACTION_DIAL);
intent.setData(Uri.parse(url));
startActivity(intent);
return true;
}else {
progressBar.setVisibility(view.VISIBLE);
view.loadUrl(url);
return true;
}
return true;
}
#Override
public void onPageFinished(WebView view, String url) {
progressBar.setVisibility(View.GONE);
}
});

How to fix On resume method is not getting called in Webview as Fragment in Fragment navigational drawer

I have a webview as fragment which extends fragment class in my fragment navigation drawer. I want to detect the back press of this fragment.
Below is code i m using to detect the back press on the fragment
getView().setFocusableInTouchMode(true);
getView().requestFocus();
getView().setOnKeyListener(new View.OnKeyListener() {
#Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK){
// handle back button
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.container,new MyFragment()).commit();
return true;
}
return false;
}
});
In my webview this method is not getting called everytime i pressed back button
public class WebViewFragment extends Fragment {
static View view;
private WebView webView;
private String url;
static int count = 0;
LinearLayout llayout;
MyProgressDialog progressDialog;
public WebViewFragment() {
}
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
if (view != null) {
ViewGroup parent = (ViewGroup) view.getParent();
if (parent != null)
parent.removeView(view);
}
try {
((AdvancedActivity) getActivity()).getSupportActionBar().hide();
view = inflater.inflate(R.layout.activity_play_lesson, container, false);
//Get webview
webView = (WebView) view.findViewById(R.id.web_view_play_lesson);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
webView.setWebContentsDebuggingEnabled(true);
}
llayout = (LinearLayout) view.findViewById(R.id.linearLayout);
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
url = getResources().getString(R.string.myurl);
url = "http://myurl//88";
System.out.println("url for myplay is "+url);
startWebView(url);
} catch (InflateException e) {
}
return view;
}
#SuppressLint("JavascriptInterface")
private void startWebView(String url) {
//Create new webviejijnw Client to show progress dialog
//When opening a url or click on link
webView.setWebViewClient(new WebViewClient() {
/*
IstarProgressDialog progressDialog;
*/
//If you do not use this method url links are opeen in new brower not in webview
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
public void onPageStarted(WebView view, String url, Bitmap favicon) {
if (progressDialog == null) {
// in standard case YourActivity.this
progressDialog = new IstarProgressDialog(getContext());
progressDialog.setMessage("Loading... Please Wait...");
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.show();
}
}
//Show loader on url load
public void onLoadResource(WebView view, String url) {
}
public void onPageFinished(WebView view, String url) {
}
#Override
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.frame_container,new ErrorFragment()).commit();
}
});
// Javascript inabled on webview
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAppCacheEnabled(true);
webView.getSettings().setDatabaseEnabled(true);
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setGeolocationEnabled(true);
webView.setWebChromeClient(new WebChromeClient() {
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);
}
});
webView.loadUrl(url);
}
#Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
// Save the state of the WebView
webView.saveState(outState);
}
#Override
public void onResume() {
super.onResume();
getView().setFocusableInTouchMode(true);
getView().requestFocus();
getView().setOnKeyListener(new View.OnKeyListener() {
#Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (event.getAction() == KeyEvent.ACTION_UP && keyCode == KeyEvent.KEYCODE_BACK){
// handle back button
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.frame_container,new MyFragment()).commit();
return true;
}
return false;
}
});
wakeLock.acquire();
}
#Override
public void onDestroy() {
super.onDestroy();
Log.d("Webview ", "The onStop() event");
}
}

set progress dialog over main layout

I have a code in which the progress dialog appears along with main layout. I want the progress dialog to be on the forefront and the main layout in background just like its showing the link enter link description here.
public class MainActivity extends Activity {
private WebView webView;
private EditText urlEditText;
private ProgressBar progress;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
urlEditText = (EditText) findViewById(R.id.urlField);
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new MyWebViewClient());
progress = (ProgressBar) findViewById(R.id.progressBar);
progress.setVisibility(View.GONE);
Button openUrl = (Button) findViewById(R.id.goButton);
openUrl.setOnClickListener(new OnClickListener() {
#SuppressLint("SetJavaScriptEnabled")
#Override
public void onClick(View view) {
String url = urlEditText.getText().toString();
if (validateUrl(url)) {
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
}
}
private boolean validateUrl(String url) {
return true;
}
});
}
private class MyWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
#Override
public void onPageFinished(WebView view, String url) {
progress.setVisibility(View.GONE);
MainActivity.this.progress.setProgress(100);
super.onPageFinished(view, url);
}
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
progress.setVisibility(View.VISIBLE);
MainActivity.this.progress.setProgress(0);
super.onPageStarted(view, url, favicon);
}
}
public void setValue(int progress) {
this.progress.setProgress(progress);
}
}
Try to use WebChromeClient instead of WebViewClient to show and update progress :
show pregress bar before call webview.loadUrl() :
if (validateUrl(url)) {
webView.getSettings().setJavaScriptEnabled(true);
progress.setVisibility(View.VISIBLE);
webView.loadUrl(url);
}
Update progress in onProgressChanged :
webView.setWebChromeClient(new WebChromeClient() {
#Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
if (newProgress == 100) {
progress.setVisibility(View.GONE);
} else {
progress.setProgress(newProgress);
}
}
});

How to listen to webview url click and enable/disable buttons on actionbar

I'm developing an application in which I'm using webview to load certain websites. I also have customized actionbar on which I have website navigation button. Here is the view how my layout is looking like:
When I load website my all three buttons are visible, but I want them to be visible at that time only when user has clicked on some URL, so user easily understand the purpose of those buttons.
I have added all the functionalities to those button. Here is my code:
website_back = (ImageButton) cView.findViewById(R.id.website_back);
website_forward = (ImageButton) cView.findViewById(R.id.website_forward);
website_refresh = (ImageButton) cView.findViewById(R.id.website_refresh);
if (v.getId() == R.id.website_back) {
webview.goBack();
}
if (v.getId() == R.id.website_forward) {
webview.goForward();
}
if (v.getId() == R.id.website_refresh) {
webview.reload();
}
My WebViewClient:
private class HelloWebViewClient extends WebViewClient {
public void onPageStarted(WebView view, String url, Bitmap favicon) {
progress.setVisibility(View.VISIBLE);
super.onPageStarted(view, url, favicon);
}
public void onPageFinished(WebView view, String url) {
progress.setVisibility(View.GONE);
super.onPageFinished(view, url);
}
public boolean shouldOverrideUrlLoading(WebView view, String url) {
website_back.setImageResource(R.drawable.webview_back);
view.loadUrl(url);
return true;
}
}
How can I only show those buttons when user has clicked on some URL, on the website launched in the webview?
Any kind of help will be appreciated.
You need to attach a WebViewClient to the WebView to listen in on the URLs that are being fetched.
mWebView.setWebViewClient(new WebViewClient() {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if(url.equals(mOriginalUrl)){
//initial url load, ignoring.
}
else {
//url was navigated to - do something
}
return super.shouldOverrideUrlLoading(view, url);
}
#Override
public void onPageFinished(WebView view, String url) {
//page has finished loading
}
});
this worked for me. hope it would be useful for you. try this
ExternalSiteActivity.class
public class ExternalSiteActivity extends Activity{
WebView webView;
String productURL;
ProgressBar progressBar;
ImageButton webBackButton;
ImageButton webForwButton;
ImageButton webRefreshButton;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.external_site_activity);
productURL= (String) getIntent().getStringExtra("productUrl");
System.out.println(productURL+"**********");
progressBar=(ProgressBar)findViewById(R.id.progress);
progressBar.setVisibility(View.INVISIBLE);
webView = (WebView) findViewById(R.id.webview);
webBackButton=(ImageButton)findViewById(R.id.web_back_button);
webForwButton=(ImageButton)findViewById(R.id.web_forw_button);
webRefreshButton=(ImageButton)findViewById(R.id.web_refresh_button);
webView.setWebViewClient(new MyWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(productURL);
webBackButton.setOnClickListener( new View.OnClickListener(){
#Override
public void onClick(View v) {
if(webView.canGoBack())
webView.goBack();
}
});
webForwButton.setOnClickListener( new View.OnClickListener(){
#Override
public void onClick(View v) {
if(webView.canGoForward())
webView.goForward();
}
});
webRefreshButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
webView.reload();
}
});
}
private class MyWebViewClient extends WebViewClient {
#Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
Log.v("shouldOverrideUrlLoading", "shouldOverrideUrlLoading");
return true;
}
#Override
public void onFormResubmission(WebView view, Message dontResend,
Message resend) {
Log.v("onFormResubmission", "onFormResubmission");
}
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
if(webView.canGoBack())
{
webBackButton.setEnabled(true);
}
else
{
webBackButton.setEnabled(false);
}
if(webView.canGoForward())
{
webForwButton.setEnabled(true);
}
else
{
webForwButton.setEnabled(false);
}
progressBar.setVisibility(View.VISIBLE);
Log.v("onPageStarted", "onPageStarted");
}
#Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
progressBar.setVisibility(View.INVISIBLE);
}
#Override
public void onLoadResource(WebView view, String url) {
Log.v("on load ","load resources----");
}
// To handle "Back" key press event for WebView to go back to previous screen.
}
#Override
public boolean onKeyDown(int keyCode, KeyEvent event)
{
if ((keyCode == KeyEvent.KEYCODE_BACK) && webView.canGoBack()) {
webView.goBack();
return true;
}
return super.onKeyDown(keyCode, event);
}
}

Categories

Resources