Dialog does not appear

后端 未结 5 2055
鱼传尺愫
鱼传尺愫 2021-01-12 01:19

I use following code:

public class Settings extends Activity implements OnClickListener {

    private Activity activity;
    private AlertDialog.Builder bui         


        
5条回答
  •  长发绾君心
    2021-01-12 02:03

    I had a somehow similar problem, in my case the dialog would appear and disappear in milliseconds: To solve it, don't call finish() or finishActivity() in the same method that calls your dialog.

    createNewDialog(SOME_CONSTANT).show();
    finish();
    

    this destroys your dialog even before you access it.

提交回复
热议问题