I’m having trouble when activity A call browser activity. Browser will parse url e when the user press back, i want the first activity will restart and not show blank page.
Here’s the code
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Integer id =getIntent().getExtras().getInt("id");
Intent browserIntent;
switch (id) {
case 1:
browserIntent = new Intent(Intent.ACTION_VIEW,Uri.parse("http:example"));
startActivity(browserIntent);
break;
etc etc
I’m not sure I completely understand your goals but I will take my best shot.
When you start a new activity B and then finish it, activity A will follow the activity lifecycle.
It sounds like you want your code in onCreate to run after B finishes but onCreate is only called during activity initialization. Perhaps if you move your switch logic to onResume(), which will be called after Activity B finishes, you will get the result you want.