I am brand new to android. I want to save the image to internal memory, and then restore the image from internal memory and load it into image view mode. I successfully saved the image in internal memory using the following code:
void saveImage() {
String fileName="img"+ cnt +".jpg";
try
{
FileOutputStream fOut=openFileOutput(fileName, MODE_PRIVATE);
bmImg.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
}
catch (Exception e)
{
e.printStackTrace();
}
}
This code is for saving jpg-image. If I want to save a gif image, how can I do this? Please help me. I see options only for jpg and png.
source
share