How do I catch (intercept) a long Bluetooth device call button press (android)?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You mean the
Intent.ACTION_CALL_BUTTON
action but than for a long press? That doesn't exist, Android offers only a limited amount of standard actions and long press on physical buttons is not included.Although if it is possible when your own activity is open, by overriding the
onKeyLongPress
method in your activity class.You're looking for is
android.intent.action.VOICE_COMMAND
, and it's an Activity intent, not a Receiver intent. You need the following in your manifest:The problem arises once your activity starts. Most of the APIs used in the Voice Command application are hidden, so you have to jump through flaming hoops to access them. Either use reflection, or see this series of articles.