Android AlertDialog does not display entire setMessage on specific devices

This is a strange case that has recently been brought to my attention. I have an activity that displays AlertDialog when it is created to alert the user to the completion of the process that must be completed to restart. On my device (Galaxy Nexus) it displays just fine. Recently, my attention was drawn to the fact that on many other devices he only showed a few words before they were cut off.

AlertDialog.Builder builder = new AlertDialog.Builder(ReportActivity.this); builder.setTitle("Finished!"); builder.setMessage("Due to the different storage mediums across the various Android devices this app may eb used for, " +"I've decided not to force a media rescan because depending on your device, " +"it may or may not even be possible. " +"This means that you will need to reboot your device or unmount/mount your sdcard in the Settings app before most players will pull in all the information for the songs." +"\n Please reboot or rescan before claiming that the app did not work.") .setCancelable(false) .setPositiveButton("Dismiss", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); lv1.setAdapter(new ResultsAdapter(ReportActivity.this, results)); } }); AlertDialog alert = builder.create(); alert.show(); 

Galaxy Nexus

Motorola photon

+1
source share
2 answers

Instead of using setMessage() try setView() by providing your own TextView , where you can control the number of lines displayed.

+3
source

Directly setting the view does not work. I needed to specify \ n for new lines, and also determine the absence of lines with the android: lines attribute

0
source

All Articles