How can I start an intent from a card in Google Glass

限于喜欢 提交于 2019-11-30 15:49:00

问题


I've tried this app, Crystal Shopper :

https://crystalshopper.herokuapp.com/

which seems to be able to start an application from a card.

As you can see in this screenshot

https://crystalshopper.herokuapp.com/static/images/barcode_search.png

there seems to be a command called

crystalshopper://open

Source seems unavailable, so I must infer...

Is correct to assume that this is simply an action which, through the Mirror API, tells the server to send a special notification to the device, which is detected by a BroadcastListener, which will then launch the required Intent?


回答1:


If an APK installed on Glass registers a custom URI scheme, Mirror API Glassware can launch it by using a menu item with the OPEN_URI action. Set the payload attribute of the menu item to the custom URI and it will launch the appropriate activity when tapped.



来源:https://stackoverflow.com/questions/18790374/how-can-i-start-an-intent-from-a-card-in-google-glass

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!