Android-Show Custom Dialog

后端 未结 6 1769
忘了有多久
忘了有多久 2021-01-24 20:15

In my android application, I am using a custom dialog. When I try to show the dialog, it causes an error. I don\'t know what I am doing wrong, and I am really confused.

<
6条回答
  •  粉色の甜心
    2021-01-24 20:34

    Try it like this:

    import android.app.AlertDialog;
    
    new AlertDialog.Builder(YourActivityName.this)
        .setTitle("Game Paused")
        .setPositiveButton("OK", null)
        .show();
    

提交回复
热议问题