A
AC Question
Please some one help me to understand I am building a simple WebView app and have override method OnBackPressed() to just make the functionality to go back if some one touches back button. Unfortunately my app closes with error "App has stopped working" meanwhile android studio also shows some run-time errors. My code is as below : -
@Override
public void onBackPressed()
{
if (view.canGoBack())
{
view.goBack();
} else
{
//otherwise exit my app
super.onBackPressed();
}
}
I dont know what is wrong please some one clear my point.
@Override
public void onBackPressed()
{
if (view.canGoBack())
{
view.goBack();
} else
{
//otherwise exit my app
super.onBackPressed();
}
}
I dont know what is wrong please some one clear my point.