Watch Video :
1. Open the project that we where dealing with. If you haven’t gone through the previous post go through it at Implement WebView To Navigation Drawer Activity
2. Add this java code in MainActivity.java file
* Go Down.
* Click Alt+Insert.
* Select Override Methods.
* Search for onKeyDown ( Just type it ).
Codes :
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction()== KeyEvent.ACTION_DOWN){
switch (keyCode){
case KeyEvent.KEYCODE_BACK:
if (webView.canGoBack()){
webView.goBack();
}
else {
finish();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
3. Now its done.Build APK. Done .
That’s all for adding Go Back on Back Press on WebView. Now on next tutorial, we would see how to add the progress bar on WebView.
I was looking at some of your articles on this site and I believe this internet site is really instructive! Keep on posting .
Great, bing took me straight here. thanks for the post. Cheers!
Outstanding quest there. What happened after? Take care!
Hey there! Do you know if they make any plugins to help
with SEO? I’m trying to get my blog to rank
for some targeted keywords but I’m not seeing very good results.
If you know of any please share. Appreciate it!
Hello, just wanted to say, I liked this blog post.
It was helpful. Keep on posting!
This page truly has all of the information I wanted concerning this subject and didn’t know who to ask.
I simply couldn’t depart your website before suggesting that I actually enjoyed the usual info a person supply to your guests? Is going to be
back frequently in order to check out new posts
When I originally commented I clicked the
“Notify me when new comments are added” checkbox and now each time a
comment is added I get four emails with the same comment.
Is there any way you can remove people from that service? Thanks!
We will check in to that…