我只想點擊圖片和一個對話框就會出現,在那個對話框中有幾個圖像我只是選擇了該圖像,我的圖像應該被該圖像替換,但我的圖像視圖變爲空白其不低於更換Imageview沒有刷新android
imgJuice.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
final Resources resources = getResources();
final Dialog dialog = new Dialog(getActivity(),
android.R.style.Theme_Dialog);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.choose_juice_image_dialog);
ImageView imgJuiceOrange = (ImageView) dialog
.findViewById(R.id.imgJuiceOrange);
imgJuiceOrange.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
imgJuice.setImageDrawable(resources
.getDrawable(R.id.imgJuiceOrange));
// also i have tried with setImageResource but nothing will be happen
dialog.dismiss();
}
});
}
對不起,我忘了:( –
偏偏..... :) – JiTHiN