我不知道如何将图像放入AlertDialog.
我有这个代码,但我认为这是不可能的.
AlertDialog.Builder alert = new AlertDialog.Builder(MessageDemo.this);
ImageView imageView = (ImageView) findViewById(R.id.imageView1);
imageView.setImageResource(R.drawable.cw);
alert.setView(imageView);
alert.setNeutralButton("Here!", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dlg, int sumthin) {
}
});
alert.show();
Run Code Online (Sandbox Code Playgroud) 我需要在手机内存中存储一个变量,然后获取该变量来显示它.
请给我一些信息或任何可供搜索的内容.谢谢
我有这个代码:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ListView lv = (ListView) findViewById(R.id.lvResult);
ListAdapter listAdapter = new ListAdapter(Prueba.this, imageList, list1, list2);
lv.setAdapter(listAdapter);
}
Run Code Online (Sandbox Code Playgroud)
它给出了一个错误:
Cannot instantiate the type ListAdapter
在同一个包中,我创建了一个ListAdapter.java用其代码调用的类.
我不知道那个错误意味着什么.
当我按下应用程序上的按钮时,我需要显示图像.
我正在尝试:
ImageView imageView = (ImageView) findViewById(R.id.imageView2);
imageView.setImageDrawable(R.drawable.loading);
Run Code Online (Sandbox Code Playgroud)
但它显示错误.
有人可以帮帮我吗?谢谢.