Problem creating a custom dialog

前端 未结 3 1521
傲寒
傲寒 2021-01-16 14:59

I have a problem creating a custom dialog. But I don\'t find the failure. Hopefully anybody can help me ...

protected Dialog onCreateDialog(int id) {
    Di         


        
3条回答
  •  北恋
    北恋 (楼主)
    2021-01-16 15:25

    I found out, that the dialog needs to be created with

    Dialog dialog = new Dialog(this);
    

    and not

    Context mContext = getApplicationContext();
    Dialog dialog = new Dialog(mContext);
    

    I don't exactly know why. Perhaps anybody can explain it to me?

提交回复
热议问题