Android 位图数组列表
您好,我想在Android 位图数组列表,android,android-layout,Android,Android Layout,您好,我想在图像视图中显示位图列表中最后一个位图。这是我的密码: SubImageView = (ImageView) findViewById(R.id.SubImageView); ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>(); bitmapArray.add(myBitMap); SubImageView=(ImageView)findViewById(R.id.SubImageView); Arr
图像视图中显示位图列表中最后一个位图。这是我的密码:
SubImageView = (ImageView) findViewById(R.id.SubImageView);
ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
bitmapArray.add(myBitMap);
SubImageView=(ImageView)findViewById(R.id.SubImageView);
ArrayList bitmapArray=新的ArrayList();
添加(myBitMap);
textview.setText(“+index”)代码>现在它工作了…当我试图只显示索引时,我出现了错误。原因是什么。?当我试图显示时,我出现了错误?你尝试了什么?我试图只显示“索引”,如textview.setText(索引);您必须将字符串设置为not int…因为它的参数是Stringtextview.setText(“+index”)代码>现在它工作了…当我试图只显示索引时,我出现了错误。原因是什么。?当我试图显示时,我出现了错误?你尝试了什么?我试图只显示“索引”,如textview.setText(索引);您必须将String设置为not int…因为它的参数是String
if(bitmapArray.size() > 0)
{
int index = bitmapArray.size() -1;
Bitmap lastbitmap = bitmapArray.get(index);
SubImageView.setImageBitmap(lastbitmap);
}