How do I open the image in the gallery by clicking on it for my application?

0

My application has a button that when pressed is opened the camera, as soon as I take the photo, it is placed in an ImageView on the screen and the image path is saved in my database. I would like to know how it does for when I click the image on the screen, it opens in the gallery with the normal size of the image, because in my application it gets small. Remember, I have the path of the image in the database: "/storage/sdcard/1442199864328.jpg".

Thank you!

    
asked by anonymous 14.09.2015 / 06:35

1 answer

0

You can create a method by calling the Gallery app using the Intent class. Create an onClick in your ImageView and call the imaging application through Intent. Example:

public void visualizarImagem(){
imageView.setOnClickListener (new OnClickListener(){
@Override
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
Uri img = Uri.parse("file://" + caminhodafoto);
intent.setDataAndType(img, "imagem/*");
startActivity(intent);}
}
);
}
    
18.09.2015 / 21:24