Go back to android
I am trying to code a reverse key in android to get back to a page that is constantly updating and changing. At the moment, he just comes back with strikes seeing the change.
Here is the code
@Override
public void onBackPressed() {
// do something on back.
super.loadUrl("file:///android_asset/www/index.html");
return;
}
I have also tried
public boolean onKeyDown(int keyCode, KeyEvent event)
{
//replaces the default 'Back' button action
if(keyCode==KeyEvent.KEYCODE_BACK)
{
//do whatever you want the 'Back' button to do
//as an example the 'Back' button is set to start a new Activity named 'NewActivity'
super.loadUrl("file:///android_asset/www/index.html");
}
return true;
}
The soft key is located to the right of the phone and does this with the phone connection.
+3
source to share
2 answers