小编fr4*_*r4n的帖子

如何将图像放入AlertDialog?Android的

我不知道如何将图像放入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)

android android-alertdialog

24
推荐指数
3
解决办法
8万
查看次数

如何在手机内存android中存储变量?

我需要在手机内存中存储一​​个变量,然后获取该变量来显示它.

请给我一些信息或任何可供搜索的内容.谢谢

android

6
推荐指数
1
解决办法
5968
查看次数

自定义ListView - 无法实例化ListAdapter类型

我有这个代码:

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用其代码调用的类.
我不知道那个错误意味着什么.

android android-listview

2
推荐指数
1
解决办法
7520
查看次数

如何在Android ImageView中设置图像

当我按下应用程序上的按钮时,我需要显示图像.

我正在尝试:

ImageView imageView = (ImageView) findViewById(R.id.imageView2);
imageView.setImageDrawable(R.drawable.loading);
Run Code Online (Sandbox Code Playgroud)

但它显示错误.

有人可以帮帮我吗?谢谢.

android android-imageview

0
推荐指数
1
解决办法
1147
查看次数