When i press the phone's camera button, both my application and the
system's camera application are launched:
- I press camera button
- After a few seconds, my camera app appears and all looks good.
- However, when i go back (back-button), i'm not brought back to where
i was before.
Instead, i'm brought (back) to the system's camera application.
It looks like both camera apps are launched: The system's camera app
is launched and on top of that my camera app is launched.
I expected the activity-chooser to appear asking which camera app i'd
like to start (with an option of making one the default).
Here are some code snippets:
Manifest:
<receiver android:name=".camera.CameraReceiver">
<intent-filter>
<action
android:name="android.intent.action.CAMERA_BUTTON"/>
</intent-filter>
</receiver>
<activity android:name=".camera.SmugCamera"
android:label="@string/app_name"
android:screenOrientation="landscape" android:icon="@drawable/
camera"
android:clearTaskOnLaunch="true"
android:taskAffinity="smugdroid.task.camera">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.media.action.IMAGE_CAPTURE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
CameraReceiver.java:
public void onReceive(Context context, Intent intent) {
KeyEvent event = (KeyEvent) intent.getParcelableExtra
(Intent.EXTRA_KEY_EVENT);
if (event == null) {
return;
}
Intent i = new Intent(Intent.ACTION_MAIN);
i.setClass(context, SmugCamera.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
Do i have to change the onReceive method to use Intent.createChooser
(...) instead?
Or is there some other problem i'm not aware of?
Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---