get bimap by uri in android

Solutions on MaxInterview for get bimap by uri in android by the best coders in the world

showing results for - "get bimap by uri in android"
Timothy
25 Feb 2017
1protected void onActivityResult(int requestCode, int resultCode, Intent data) {
2        super.onActivityResult(requestCode, resultCode, data);
3
4  if (requestCode == PICK_IMAGE_REQUEST && resultCode == RESULT_OK && data != null && data.getData() != null) {
5                Uri filePath = data.getData();
6
7     try { //Getting the Bitmap from Gallery
8           Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), filePath);
9           rbitmap = getResizedBitmap(bitmap, 250);//Setting the Bitmap to ImageView
10           serImage = getStringImage(rbitmap);
11           imageViewUserImage.setImageBitmap(rbitmap);
12      } catch (IOException e) {
13           e.printStackTrace();
14      }
15
16
17   }
18}
19