I am trying to launch my app when the camera button is pressed.
However, when I do this the camera app is launched first and then my
app is launched.  How do I get an activity choosing dialog to prevent
this from happening?

Aside from having the camera permission, this is what I have in my
manifest:

<receiver android:name=".MultiTaskerCameraReceiver">
  <intent-filter>
    <action android:name="android.intent.action.CAMERA_BUTTON" />
  </intent-filter>
</receiver>

Here is the code of my receiver:

public void onReceive(Context context, Intent intent)
        {
                if (intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) != null)
                {
                        Intent newIntent = new Intent(Intent.ACTION_MAIN);
                        newIntent.setClass(context, ActivityListView.class);
                        newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                        context.startActivity(newIntent);
                }
        }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to