This is done using intent filters. Add the following tag to your manifest:
<activity android:name=".CameraActivity" android:clearTaskOnLaunch="true"> <intent-filter> <action android:name="android.media.action.IMAGE_CAPTURE" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity>
Now your application will appear in the list when the user wants to take a picture.
EDIT:
Here is the correct way to return a bitmap:
Uri saveUri = (Uri) getIntent().getExtras().getParcelable(MediaStore.EXTRA_OUTPUT); if (saveUri != null) {
You can also check the built-in android website Camera source code .
Dalmas
source share