1

This is an odd case that was just recently brought to my attention. I have an activity that displays an AlertDialog when it is created to warn the user that to complete the process they need to reboot. On my device (Galaxy Nexus) it displays just fine. It was just recently brought to my attention that on a lot of other devices its only displaying a few words before being 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

r2DoesInc
  • 3,759
  • 3
  • 29
  • 60
  • Related: http://stackoverflow.com/questions/9795347/long-text-goes-to-next-line-on-ics-but-not-on-gb-and-below/9847862 – Blundell Mar 23 '12 at 23:47

2 Answers2

4

Rather than use setMessage(), try setView(), supplying your own TextView where you can control the number of lines that are displayed.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 1
    ill give that a shot, but for future reference, do you have any idea why its behaving the way that it is? ive never had an issue like this before. its not only this screen thats causing me grief either. i have another screen with a textview and a button that displays fine on my device and only displays a single line on some others. – r2DoesInc Mar 03 '12 at 02:06
0

Directly setting view doesn't work.I had to specify \n for new lines and also define no of lines with android:lines attribute