Android activity
•
Android
I have five activities. The process is like this
In activity 5, press the back button to return to activity 2 or 3 after completing any activity? At present, I'm only the fourth
resolvent:
If you want to get 2 or 3, you want to write code on the back
@Override
public boolean onKeyDown(int i, KeyEvent event) {
if (i == KeyEvent.KEYCODE_BACK) {
Intent i=new Intent(getbaseapplicationcontext(),activity2.class)
startActivity(i)
return true;
}
return super.onKeyDown(i, event);
}
Another way is
If you want to complete any activities you don't want, you need activity4 here
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码