I am using two activities. One activity displays images in a GridView
and by clicking on a particular image in that GridView
it should display the full screen image in another activity.
How can I achieve this?
My MyGridView.java
mGridView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int position,long id) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "Image"+(position+1),Toast.LENGTH_SHORT).show();
System.out.println(id);
Intent i = new Intent(this, MyImageViewActivity.class);
Bundle bundle = new Bundle();
bundle.putInt("image", position);
i.putExtras(bundle);
startActivityForResult(i, 0);
}
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…