Android AlertDialog Single Button

后端 未结 9 1692
陌清茗
陌清茗 2020-12-12 12:08

I\'d like to have an AlertDialog builder that only has one button that says OK or Done or something, instead of the default yes and no. Can that be done with the standard Al

9条回答
  •  一向
    一向 (楼主)
    2020-12-12 12:18

    This is the closer I could get to the one liner this should be if the Android API was any smart:

    new AlertDialog.Builder(this)
        .setMessage(msg)
        .setPositiveButton("OK", null)
        .show();
    

提交回复
热议问题