I tried to get the message and the following line of code works:
TextView dialogMessage = (TextView)dialogObject.findViewById(android.R.id.message);
<
To avoid the code from breaking, when Google decides to change its dialog title view id in the future, here is more reliable solution.
We will simply return the first encountered View, which its type is TextView.
//
// Usage: findFirstEncounteredType(getDialog().getWindow().getDecorView(), TextView.class)
//
public static View findFirstEncounteredType(View view, Class extends View> klass) {
if (klass.isInstance(view)) {
return view;
} else {
if (!(view instanceof ViewGroup)) {
return null;
}
}
ViewGroup viewGroup = (ViewGroup)view;
for (int i=0, ei=viewGroup.getChildCount(); i