I have a grid of many products in my app. when the user selects one of the item in the grid, I am starting a new activity as DIALOG box and display the item's name,quantity and image. But I cannot send the image source dynamically.
here is my code
gridView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v,int position, long id) {
//Toast.makeText(getApplicationContext(),((TextView) v.findViewById(R.id.grid_item_label)).getText(), Toast.LENGTH_SHORT).show();
Intent item_intent = new Intent(MainActivity.this, Item.class);
item_intent.putExtra("name",((TextView) v.findViewById(R.id.grid_item_label)).getText());
item_intent.putExtra("quantity",((TextView) v.findViewById(R.id.grid_item_quantity)).getText());
//my problem is here***************************************************
ImageView my_image = findViewById(R.id.grid_item_image).getDrawable();
item_intent.putExtra("image",my_image.getXXXXX());
//*********************************************************************
MainActivity.this.startActivity(item_intent);
}
});
What should I use to get the image source from ImageView?