I have a layout which consists of an ImageView and a TextView. I recently changed android:src for ImageView to a new drawable, but when I am building and running the app on emulator or device its showing the old image instead of the new image that I have specified in XML Layout. I don’t understand why the references are not getting updated and android is using the old reference of the image.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/list_selector"
android:orientation="horizontal"
android:padding="3dip" >
<ImageView
android:id="@+id/playImage"
android:layout_width="35dip"
android:layout_height="35dip"
android:src="@drawable/play_icon" />
<TextView
android:id="@+id/playlistName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/black"
android:maxLines="1"
android:layout_toRightOf="@+id/playImage"
android:paddingLeft="5dp"
android:textStyle="bold"
android:text="Unamed" />
</RelativeLayout>
Please help me.
I did a silly mistake.I was also Setting the ImageView image in my custom adapter and that was overriding the XML ImageView default image.I removed the code of setting image src from adapter and this fixed the issue