【发布时间】:2011-10-14 05:38:24
【问题描述】:
我在布局中使用带有自定义适配器的列表视图。 现在我正在尝试将包含列表的布局带到我的警报对话框中。 我尝试使用此代码将不包含列表的简单布局引入警报对话框,并且运行良好。 但我无法将包含布局的列表带入 alertdialog。
AlertDialog.Builder dialog = new AlertDialog.Builder( this );
dialog.setView( getLayoutInflater().inflate( R.layout.smill, null ) );
dialog.setIcon(R.drawable.androidsmile);
dialog.setInverseBackgroundForced(true);
dialog.setTitle( "Select smiley");
dialog.setPositiveButton( "Cancel", null );
dialog.show();
【问题讨论】:
-
您能详细说明您的应用程序出了什么问题吗?它是否强制关闭或列表视图未显示或其他任何内容。
标签: android listview android-alertdialog custom-adapter