How to get the AlertDialog title?

后端 未结 5 799
無奈伤痛
無奈伤痛 2020-12-30 03:09

I tried to get the message and the following line of code works:

TextView dialogMessage = (TextView)dialogObject.findViewById(android.R.id.message);
<         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 03:49

    I know the question mentions AlertDialog, but if you came here through a Google search and looking for the answer for a DialogFragment:

    getDialog().findViewById(android.R.id.title))
    

提交回复
热议问题