Hi, i need to start a service or activity by pressing a button from a Bluetooth remote device from home screen or when the device is idle.
Below the logs when pressing the button.
ViewRoot's KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_ENTER, scanCode=28, metaState=0, flags=0x8, repeatCount=0, eventTime=33143014, downTime=33143014, deviceId=29, source=0x101 } to com.android.keyguard.KeyguardViewManager$ViewManagerHost{4211a9f8 V.E..... ........ 0,0-720,1280}
interceptKeyTi keyCode=66 down=false repeatCount=0 keyguardOn=true mHomePressed=false canceled=false
ViewRoot's KeyEvent { action=ACTION_UP, keyCode=KEYCODE_ENTER, scanCode=28, metaState=0, flags=0x8, repeatCount=0, eventTime=33143017, downTime=33143014, deviceId=29, source=0x101 } to com.android.keyguard.KeyguardViewManager$ViewManagerHost{4211a9f8 V.E..... ........ 0,0-720,1280}
It sends KEYCODE_ENTER. I've tried using a static receiver with the below
AddReceiverText(s1,
<intent-filter android
riority="2147483647">
<action android:name="android.intent.action.KEYCODE_ENTER"/>
</intent-filter>
)
but the service didn't started. Perhaps the event "android.intent.action.KEYCODE_ENTER" is not correct. Any ideas how to trap this?
Below the logs when pressing the button.
ViewRoot's KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_ENTER, scanCode=28, metaState=0, flags=0x8, repeatCount=0, eventTime=33143014, downTime=33143014, deviceId=29, source=0x101 } to com.android.keyguard.KeyguardViewManager$ViewManagerHost{4211a9f8 V.E..... ........ 0,0-720,1280}
interceptKeyTi keyCode=66 down=false repeatCount=0 keyguardOn=true mHomePressed=false canceled=false
ViewRoot's KeyEvent { action=ACTION_UP, keyCode=KEYCODE_ENTER, scanCode=28, metaState=0, flags=0x8, repeatCount=0, eventTime=33143017, downTime=33143014, deviceId=29, source=0x101 } to com.android.keyguard.KeyguardViewManager$ViewManagerHost{4211a9f8 V.E..... ........ 0,0-720,1280}
It sends KEYCODE_ENTER. I've tried using a static receiver with the below
AddReceiverText(s1,
<intent-filter android
<action android:name="android.intent.action.KEYCODE_ENTER"/>
</intent-filter>
)
but the service didn't started. Perhaps the event "android.intent.action.KEYCODE_ENTER" is not correct. Any ideas how to trap this?
Last edited: