Search This Blog

Showing posts with label Media. ResolveInfo. Show all posts
Showing posts with label Media. ResolveInfo. Show all posts

Friday, October 14, 2016

Pick images from default gallery intent

Pick image from default gallery images... from android


final PackageManager packageManager = getPackageManager();
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);

List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
                                                      PackageManager.MATCH_DEFAULT_ONLY);
if (list.size() > 0) {
         startActivityForResult(intent, PICK_IMAGE_REQUEST);
} else {
          Toast.makeText(UserProfileEditActivity.this, "No app can perform this action",                        Toast.LENGTH_LONG).show();
           return;
}