杀死它后我有透明的活动(onStop/onDestroy)我想创建对话框但我收到错误:
java.lang.RuntimeException: Unable to destroy activity {package name/myclass}: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
孔代码如下所示:
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");
}
}
PS 创建对话框有效,因此无需在此处放置 DialogChoideActivity 代码。