how to save imageView to gallery by using it's Id instead of its name?

Home - how to save imageView to gallery by using it's Id instead of its name?

Chintia Widyasari asked 6 months ago

Drawable drawable = getResources().getDrawable(R.drawable.im);

bitmap = ((BitmapDrawable)drawable).getBitmap();

            ImagePath=MediaStore.Images.Media.insertImage(
                    getContentResolver(),
                    bitmap,
                    "mm",
                    "mm"
            );
            URI = Uri.parse(ImagePath);
            Toast.makeText(MainActivity.this, ImagePath, Toast.LENGTH_LONG).show();
Your Answer