This question already has an answer here:
My problem is android image view not showing image. its show image src path. I want to show image from android local storage[sdcard].
My xml file code is:
ImageView imageView = (ImageView) convertView.findViewById(R.id.imgView);
File imgFile = new File(path);
imageView.setImageURI(Uri.fromFile(imgFile));
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/lblMsgFrom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12dp"
android:textColor="@color/blue"
android:textStyle="italic"
android:padding="5dp"/>
<ImageView
android:id="@+id/imgView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0"></ImageView>
</LinearLayout>
Its show image path[string]. I need help.
Aucun commentaire:
Enregistrer un commentaire