เปลี่ยนรูปภาพของ ImageView โดยทางโปรแกรมใน Android
เมื่อฉันเปลี่ยนรูปภาพโดยทางโปรแกรมจะแสดงภาพใหม่ที่ด้านบนของภาพเก่าซึ่งตั้งค่าไว้ในไฟล์เลย์เอาต์? นี่คือตัวอย่างไฟล์เลย์เอาต์ของฉัน: <LinearLayout android:layout_width="match_parent" android:layout_height="39dp" android:gravity="center_vertical" > <ImageView android:id="@+id/qStatusImage" android:layout_width="16dp" android:layout_height="16dp" android:layout_margin="5dp" android:background="@drawable/thumbs_down" /> <TextView android:id="@+id/grp_child" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@color/radio_colors" android:textStyle="normal" android:background="@color/grey" /> </LinearLayout> และรหัสที่ตั้งค่า imageView: @Override public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild, View convertView, ViewGroup parent) { //Answers if(answersGroup != null) answersGroup.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public …