0
我正在處理我的應用中用戶配置文件的照片部分。 我有一個關於我的活動背景圖片的按鈕。當我點擊按鈕它將重定向到畫廊,我想選擇一個圖像。所選圖像將替換按鈕中的背景。下面
是我的佈局文件從庫中選擇照片,用所選照片替換背景圖片
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Choose Picture"
android:background="@drawable/icon_user"
android:id="@+id/ChoosePictureButton"/>
</LinearLayout>
如何做到這一點?任何想法?