当前位置: 代码迷 >> Android >> android中ImageView中默认选择的图片啊解决方案
  详细解决方案

android中ImageView中默认选择的图片啊解决方案

热度:96   发布时间:2016-05-01 21:17:07.0
android中ImageView中默认选择的图片啊
我在GridView中选择了图片转到ImageView中显示,为什么还总是显示List中的第一张啊?(我使用BaseAdapter)
if (!fList.isEmpty()) {
listIndex = intent.getIntExtra("listIndex", 0);
System.out.println("GralleryProjectAct + 得到的" +listIndex );
BitmapDrawable bdraw = new BitmapDrawable(decodeFile(new File(fList.get(listIndex))));
GralleryProjectAct.this.switcher.setImageDrawable(bdraw);
}
测试的时候listIndex 是有变化的,但是最终显示时还是默认为第一张啊???

------解决方案--------------------
说明问题不是出在这个地方噢,检查看看哪里的代码才是更新ImageView的。

探讨

引用:
把BitmapDrawable bdraw = new BitmapDrawable(decodeFile(new File(fList.get(listIndex))));这句改一下

BitmapDrawable bdraw = new BitmapDrawable(decodeFile(new File("/mnt/sdcard/DCIM/.thumbnai……
  相关解决方案