Custom icon and text in Intent Chooser

android, android-intent

Solution

read this http://developer.android.com/guide/topics/manifest/activity-element.html, note "label" and "icon" attributes

Problem

I need to allow user to pick an image or take a new photo. I've implemented a custom camera activity. When the user click on a button, an Intent Chooser is launched, asking among apps that allow to pick an image. Among them, I've added an intent that start my camera activity in order to take a new picture. ``` Intent pickImageIntent = new Intent(Intent.ACTION_PICK, Media.EXTERNAL_CONTENT_URI); pickImageIntent.setType("image/jpeg"); Intent takePhotoIntent = new Intent(this, CameraActivity.class); takePhotoIntent.putExtra(MediaStore.EXTRA_OUTPUT, file.getAbsolutePath()); Intent chooserIntent = Intent.createChooser(pickImageIntent, ""); if (getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { takePhotoIntent }); startActivityForResult(chooserIntent, 0); ``` The problem is that among the icons in the dialog of the Intent Chooser there is also the icon of my app and its name, because of the camera intent. Is it possible to customize the icon and the label instead of using the app ones?

Original source