Putting text into an AlertDialog box as a CharSequence using setMessage() causes the text to display at the default system size.
However, if the text is a TextView object, then it is added using setView() and the resulting output is a tiny font.
I know that I can define a specific font size for a TextView object (that’s the point of it after all), but how / where do I tell the project to use the same font size setting as is used by setMessage()? Since setMessage()’s resulting font size depends on the system settings that the user has set up on their device, and I’d like to be able to cater for visually impaired users without the need to resort to a font size menu within my app.
Alternatively, if anyone knows a way of pushing a SpannableString to an AlertDialog using setMessage(), that would be a suitable solution too…
refer to Typography
You can just set the font size to
18spforMedium size(which is used bysetMessage()), and about the user preference,spitself will scale according to it.