2011-02-16 65 views
1

我想訪問從gridview中選擇圖像的屬性。例如,如果我正在使用。需要訪問Android中的選定項目的圖像gridview

GridView gridview = (GridView) findViewById(R.id.imageGallery); 
    gridview.setAdapter(new ImageAdapter(this)); 

    gridview.setOnItemClickListener(new OnItemClickListener() { 
    public void onItemClick(AdapterView<?> parent, View v, int position,long id) 
    { 
     //need code in here that I can do something like this. 
     //Get access to the integer value of the R.drawable.myimage 
     //use that int too do a lookup in a dictionary to check for existance 
     //can't see to find any code to get at the drawable associated with the image clicked in the grid, did intense debug 

和數據不容易在運行時可見

} 
    ); 

回答