Android AlertDialog 在某些设备上不显示整个 setMessage

标签 android android-alertdialog

这是一个奇怪的案例,最近才引起我的注意。我有一个 Activity 在创建时显示 AlertDialog 以警告用户要完成他们需要重新启动的过程。在我的设备 (Galaxy Nexus) 上,它显示得很好。最近才引起我的注意,在许多其他设备上它只显示几个字就被切断了。

        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

最佳答案

与其使用 setMessage(),不如尝试 setView(),提供您自己的 TextView,您可以在其中控制显示的行数显示。

关于Android AlertDialog 在某些设备上不显示整个 setMessage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9542284/

相关文章:

android - 如何在 MATLAB 中训练英国车牌的神经网络?

java - 从 InputStream 读取时出现 IOException

android - 在警报对话框中为数字选择器设置值

java - 如何删除 AlertDialog.Multiple Choice 中的第一个复选标记

java - Android Studio React Native 应用未运行 : AAPT2 error: check logs for details

java - 还是个问题? - java.util.zip.ZipException : Central Directory Entry not found

java - JarJar'ed artefact 和 Maven 部署过程

android-alertdialog - Flutter 对话框以某种方式触发父小部件的导航器路由

android - AlertDialog 类转换异常

android - AlertDialog 不显示三星 Galaxy s4 中的正负按钮