当前位置: 代码迷 >> Android >> android源码中AlertController.AlertParams有关问题
  详细解决方案

android源码中AlertController.AlertParams有关问题

热度:29   发布时间:2016-04-28 04:34:38.0
android源码中AlertController.AlertParams问题
AlertController.AlertParams p = mAlertParams;
        p.mPositiveButtonText = getString(R.string.updating_button_install);
        p.mPositiveButtonListener = this;       //请教这边的this代表的啥
        p.mNegativeButtonText = getString(R.string.updating_button_cancel);
        p.mNegativeButtonListener = this;


我不懂得是上面的listener设置为this是啥意思,相当于退出吗?
还有一点就是我想设置p的属性,让这个提示框显示的时候不会被应用所覆盖,该如何做呢?
------解决方案--------------------
因为AlertParams中有public DialogInterface.OnClickListener mPositiveButtonListener;变量

所以这个this指的就是你当前activity,它继承了OnClickListener 
  相关解决方案