earlier today i posted a question on how to open an image from a gallery.as a member answered i followed this tutorial http://www.androidpeople.com/android-gallery-imageview-example/… my question now is,i would like to open the images in a dialog and no down of my gallery.is it possible?thanks
private Integer[] mImageIds = {
R.drawable.a,
R.drawable.aa,
R.drawable.aaa,
R.drawable.aaaa
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
imgView = (ImageView)findViewById(R.id.ImageView01);
imgView.setImageResource(mImageIds[0]);
Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int position, long id) {
imgView.setImageResource(mImageIds[position]); }
});
Try the Dialog class. It is similar to an Activity: