Unable to select particular images using ACTION_PICK intent

前端 未结 2 1095
小鲜肉
小鲜肉 2020-12-06 03:29

I\'m using an intent like this:

Intent intent = new Intent(Intent.ACTION_PICK,
        android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
         


        
2条回答
  •  无人及你
    2020-12-06 04:16

    hops this will helps you ....

    ACTIVITYRESULT_CHOOSEPICTURE is the int you use when calling startActivity(intent, requestCode);

    public void onActivityResult(int requestCode, int resultCode, Intent data) {
      if(requestCode == ACTIVITYRESULT_CHOOSEPICTURE) {
        BitmapFactory.Options options = new BitmapFactory.Options();
        final InputStream ist = ontext.getContentResolver().openInputStream(intent.getData());
        final Bitmap bitmap = BitmapFactory.decodeStream(ist, null, options);
        ist.close();
      }
    }
    

    if above code doesn't work than just refer this link... it will surly shows the way

    http://dimitar.me/how-to-get-picasa-images-using-the-image-picker-on-android-devices-running-any-os-version/

提交回复
热议问题