Android change bitmap src inside the application -


i've got application , change bitmap source inside code. have got main layout:

<?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="fill_parent"    android:paddingleft="5px"    android:paddingright="5px"    android:paddingtop="5px"    android:background="@drawable/my_image" > ... </relativelayout> 

here xml background:

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:dither="true" android:gravity="bottom|right" android:src="@drawable/image" /> 

now, when there image name inside source works, change when select list item in previous class. know there getresources, don't know how solve bitmap. when there string it's easy, in way don't know go.

put xml of bitmap in drawable folder , set background resource android:background="@drawable/bitmap" (bitmap name of xml in drawable). or give id relative layout , use relativelayout.setbackgroundresource() method.


Comments