I tried to get the message and the following line of code works:
TextView dialogMessage = (TextView)dialogObject.findViewById(android.R.id.message);
<
I checked up the code of the AlertDialog. Internally they use R.id.alertTitle to initialize the AlertDialog title's TextView. You can use getIdentifier to retrieve it:
int titleId = getResources().getIdentifier( "alertTitle", "id", "android" );
if (titleId > 0) {
TextView dialogTitle = (TextView) dialogObject.findViewById(titleId);
if (dialogTitle != null) {
}
}
Edit: for AppCompat, the third argument of getIdentifier should be the package name of your app. You can retrieve the latter with context.getPackageName()