I have a TabActivity, and each Tab corresponds to its own Activity. In one of them, in the onCreate method, I use startActivityForResult to show a dialog (specifically, Bump's BumpAPI activity).
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
bump = new Intent(this, BumpAPI.class);
bump.putExtra(BumpAPI.EXTRA_API_KEY, API_KEY);
startActivityForResult(bump, BUMP_API_REQUEST_CODE);
}
The problem is that when the screen orientation changes, it tries to create the tab's activity again which makes another BumpAPI dialog, resulting in multiple stacked on top of each other. Do I have a hook into the started activity to cancel the previous one when the orientation changes?
A workaround seems to be to add a button that when clicked, starts the second activity, but that adds an unnecessary step.
Also, I can't fix the screen orientation for the entire tabActivity because some of them require typing and users may want to use their physical keyboards.