You need to take the url pictures from the gallery and save the link to the database so that you can open it later. I saved the link, but the file will not open.
@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) { Uri uri = data.getData(); try { Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri); imageView = (ImageView) findViewById(R.id.image); imageView.setImageBitmap(bitmap); uriImg = uri.toString(); } catch (IOException e) { e.printStackTrace(); } } }
I try to open, but nothing happens.
File imgFile = new File(uriImg); if (imgFile.getAbsoluteFile().exists()){ Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath()); imageView.setImageBitmap(myBitmap);
content://media/external/images/media/64
- Bogdan Shulga