Android 6.0 Dialog text doesn't appear

后端 未结 11 2096
感情败类
感情败类 2020-12-15 17:02

I updated my phone to Android 6.0 and I have these 2 problems with dialogs:

1)The title is shown but the messages isn\'t for alert dialog(SOLVED):

          


        
11条回答
  •  温柔的废话
    2020-12-15 17:18

    @Override
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            // Use the Builder class for convenient dialog construction
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setMessage(R.string.dialog_fire_missiles)
                   .setPositiveButton(R.string.fire, new DialogInterface.OnClickListener() {
                       public void onClick(DialogInterface dialog, int id) {
                           // FIRE ZE MISSILES!
                       }
                   })
                   .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                       public void onClick(DialogInterface dialog, int id) {
                           // User cancelled the dialog
                       }
                   });
            // Create the AlertDialog object and return it
            return builder.create();
        }
    

    Once check this hope this will work.......

提交回复
热议问题