3

I would like to know when my app has been launched by voice control ("Ok Google, launch MyApp") in order to present the users a different activity where they can interact using their voice.

The idea is "if the user launches the app using the Ok Google command, he probably wants a hands-free interaction".

Is there a way to know it? Intent categories and flags don't seem helpful.

Lucciconio
  • 31
  • 1
  • This may be what you require. http://stackoverflow.com/questions/27480724/detect-whether-wear-app-started-with-voice-command-or-touch-input – Yokomoko May 03 '17 at 15:44
  • Unfortunately not. Probably in that case it works since it is a wearable application (but it's only a guess, I've no experience in wearable app). In my case the intent is always: { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=my.app cmp=my.app/.MyActivity } The only thing that changes is the flg field, but I can't see any connection with the launch mode. – Lucciconio May 04 '17 at 06:56

0 Answers0