0
I’m starting in the area of android app development. So I started to develop an application which I created 4 layouts ( Main screen, central subscriber, contact and plans). In the subscriber’s central Activity I put a webview and when the client presses the back button can navigate the pages with this code I put in the java of Activity:
Override
public void onBackPressed(){
if (mywebView.canGoBack()){
mywebView.goBack();
} else {
}
Only when the client navigates inside the webview and goes back to the main web page through the mobile button, it stops at this page and does not return to the menu.
I tried to create a back button with startactivity in the header to return to the menu, but gives error saying "the application stopped".
Thanks in advance for the help!
Perfect! Thank you very much. It worked!
– Zara Canuts
If it’s not too much! I’d like to put a button in the header for the main menu. I declared startactivity in main.java and called on the button inside Activity with android:onclick:"startactivity". Is giving error. There’s another way to do it?
– Zara Canuts