Hi,

     I did what is described above. However, pressing the "native"
camera button doesn't trigger the BroadcastReceiver.onReceive()
invocation. Do I need to specify a specific permission? Am I missing
something else? Is there any other  "Camera button" on the SDK  than
the central key?
<manifest xmlns:android="http://schemas.android.com/apk/res/android";
        package="com.mycompany.android" android:versionCode="1"
        android:versionName="1.0.0">
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.CAMERA" />
        <application android:icon="@drawable/icon" android:label="@string/
app_name">
                <activity android:name=".MyApp" 
android:label="@string/app_name">
                        <intent-filter>
                                <action 
android:name="android.intent.action.MAIN" />
                                <category 
android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>
                </activity>
                <receiver android:name=".main.MyReceiver">
                        <intent-filter>
                        <action 
android:name="android.intent.action.CAMERA_BUTTON" />
                        </intent-filter>
                </receiver>
        </application>
</manifest>


Armand

On Nov 14, 8:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Thanks Guys. I added a receiver with CAMERA_BUTTON intent-filter and
> it then triggers my Main application. But I am not getting the choose
> application dialog. Instead, both my Main application and camera
> application opens.
>
> <activity android:name="MainApp"
>                   android:label="@string/app_name"
>                   android:theme="@android:style/Theme">
>             <intent-filter>
>                 <action android:name="android.intent.action.MAIN" />
>                 <category
> android:name="android.intent.category.LAUNCHER" />
>             </intent-filter>
>             <intent-filter>
>                 <action
> android:name="android.intent.action.MY_INTENT"></action>
>                 <category
> android:name="android.intent.category.DEFAULT" />
>             </intent-filter>
>  </activity>
> <receiver android:name="MyReceiver">
>     <intent-filter>
>         <action android:name="android.intent.action.CAMERA_BUTTON"/>
>     </intent-filter>
> </receiver>
>
> public class MyReceiver extends BroadcastReceiver {
>
>         @Override
>         public void onReceive(Context context, Intent intent) {
>                 Intent newIntent = new 
> Intent(".android.intent.action.MY_INTENT");
>                 context.startActivity(newIntent);
>         }
>
> }
>
> -abhi
>
> On Nov 14, 2:53 am, Ludwig <[EMAIL PROTECTED]> wrote:
>
> > If you have more than one best matching activity for an intent is to offer
> > you a list to pick the desired activity, with the option of using one as the
> > default (ie do not ask again). It is easy to trigger, just by defining two
> > activities with the same intent...Ludwig
>
> > 2008/11/14 blindfold <[EMAIL PROTECTED]>
>
> > > What happens when more than one application has this in the manifest?
>
> > > Thanks
>
> > > On Nov 14, 8:53 am, "[EMAIL PROTECTED]"
> > > <[EMAIL PROTECTED]> wrote:
> > > > Register to receive the intent "android.intent.action.CAMERA_BUTTON".
> > > > Here's how you might add it to your app's manifest:
>
> > > > <receiver android:name="CameraButtonIntentReceiver">
> > > >     <intent-filter>
> > > >         <action android:name="android.intent.action.CAMERA_BUTTON"/>
> > > >     </intent-filter>
> > > > </receiver>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to