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?
read this http://developer.android.com/guide/topics/manifest/activity-element.html, note "label" and "icon" attributes
Just specify the name and icon in your activity in AndroidManifest.xml. Like this:
<activity android:label="Camera" android:icon="@drawable/myCameraIcon" android:name=".CameraActivity" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With