I have a problem setting correct Bluetooth headset for handling voice recognition command .
I hit bluetooth key and voice recognition is never stopping !!! after first vr.listen ???
What I succeded is to start activity and voice recognition on activity resume and that is great but somehow do not know how to handle the intent because it seems that this action "android.intent.action.VOICE_COMMAND" is showing on logs no mather the action ..bluetooth headset button pressed ,,vr.listen, ... browser or other intents..
Is something wrong in my code ?
I do have prolems understanding how to parse the intents all though i have passed over some tutorials here ...
'here is the manifest declaration
I hit bluetooth key and voice recognition is never stopping !!! after first vr.listen ???
What I succeded is to start activity and voice recognition on activity resume and that is great but somehow do not know how to handle the intent because it seems that this action "android.intent.action.VOICE_COMMAND" is showing on logs no mather the action ..bluetooth headset button pressed ,,vr.listen, ... browser or other intents..
Is something wrong in my code ?
I do have prolems understanding how to parse the intents all though i have passed over some tutorials here ...
B4X:
Sub Activity_Resume ' good practice work with files in activity resume
Log(Activity.GetStartingIntent)
Dim strintent As Intent
strintent=Activity.GetStartingIntent
If strintent.Action = "android.intent.action.VOICE_COMMAND" Then
show_btmode
VR.Prompt="SAY A COMMAND"
VR.listen
End If
End Sub
'here is the manifest declaration
B4X:
AddActivityText(main, <intent-filter android:priority="1000">
<action android:name="android.intent.action.VOICE_COMMAND" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>)
'this is for handling the connection status
AddReceiverText(s2, <intent-filter>
<action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
<action android:name="android.bluetooth.device.action.ACTION_ACL_DISCONNECTED"/>
</intent-filter>)
AddPermission(android.permission.BLUETOOTH)
Last edited: