구성 활동의 사용자가 버튼에서 사용할 다양한 그래픽 중에서 선택할 수있는 위젯을 작성 중입니다 ImageView (또는 ImageButton) 과 StateListDrawable). 선택한 그래픽은 위젯이 추가 될 때 위젯 레이아웃에 사용됩니다. 레이아웃은 다음과 같습니다구성 활동의 사용자 선택에 따라 위젯에서 StateListDrawable을 ImageButton/ImageView.backgroundDrawable로 설정하십시오.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center">
<ImageView
android:id="@+id/button"
android:layout_width="72dip"
android:layout_height="72dip"
android:background="@null"
android:clickable="true">
</ImageView>
</LinearLayout>
내 질문입니다, 내가 구성 활동 사용자의 선택에 따라 위젯에 표시된하여 ImageButton에서 선택한 backgroundResource을 설정하는 방법?