我在我的XML文件中有一個gridview,其中存儲多個圖像。單擊單個圖像時,將出現一個帶圖像視圖的警告對話框。我想在該圖像視圖上顯示特定點擊的圖像。我怎樣才能做到這一點?Android Gridview和ImageView
gv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
final picturebean pb=ilist.get(arg2);
AlertDialog.Builder abpic=new AlertDialog.Builder(ShowPicActivity.this);
abpic.setTitle("Pic View");
abpic.setCancelable(true);
LayoutInflater li=getLayoutInflater();
View vi = li.inflate(R.layout.picmenu, null);
abpic.setView(vi);
ImageView iv=(ImageView)vi.findViewById(R.id.imageView1);
你能分享設置gridview的 –