I have transparent activity after I kill it (onStop/onDestroy) i want to create Dialog but I getting error :
java.lang.RuntimeException: Unable to destroy activity {package name/myclass}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
hole code looks like :
public class TransparentTip extends FragmentActivity {
Button ok;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.transparent_tip);
ok=(Button)findViewById(R.id.bToK);
}
public void buttonClick(View view) {
if (view.getId() == R.id.bToK)
{
finish();
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
}
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
}
@Override
protected void onDestroy()
{
super.onDestroy();
DialogChoiceActivity dialog = new DialogChoiceActivity();
dialog.show(getSupportFragmentManager(),"my_dialog");
}
}
P.S Creating dialog works so there is no need to put here DialogChoideActivity code.