camera - android.intent.action.CAMERA_BUTTON not broadcasting on Desire Z (Froyo)? -


i have hard time intercepting hw camera button on desire z (froyo). wrote sample runs fine on g1 (1.6) not on aforementioned phone.

androidmanifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.company" android:versioncode="1" android:versionname="1.0"> <uses-sdk android:minsdkversion="4" />  <application android:icon="@drawable/icon" android:label="@string/app_name">     <activity android:name=".camerareceivertestactivity"         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:enabled="true" android:exported="true"         android:name=".camerabuttonreceiver">         <intent-filter android:priority="999">             <action android:name="android.intent.action.camera_button" />             <category android:name="android.intent.category.default" />         </intent-filter>     </receiver> </application> </manifest> 

and camerabuttonreceiver.java

package net.company;  public class camerabuttonreceiver extends broadcastreceiver {   static {     log.w("cbr", "onreceive clazz init");   }    @override   public void onreceive(context context, intent intent) {       log.w("cbr", "onreceive camera");       abortbroadcast();   } } 

on g1 (1.6) see both messages press camera button , default camera app suppressed. however, on desire z (froyo) no such thing happens. after playing priority, code/xml declarations dare phone sends broadcast other name.

there no requirement device manufacturer send broadcast when camera button clicked, reading of compatibility definition document. might used foreground activity on desire z. don't have z , cannot confirm tests.

since vast majority of android devices not have camera button @ all, need ensure app works without such button, , advise users camera button may or may not work app depending upon device.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -