Android: Recognising Gestures when screen is locked

可紊 提交于 2019-12-04 05:30:36

问题


I am currently in the process of creating an MP3 player. In particular, the main mode of user input is in the form of (touchscreen) gestural input. I would like to add the functionality allowing users to continue interacting with the MP3 player when the screen is locked. That is, how can I get the device (A Galaxy S3 in particular if it's worth mentioning) to recognise gestures in the lock screen and "parse" them to the MP3 player?

Note: by "locked" I mean when one can see the lock screen (i.e. not when the screen is turned off).

How would I go about doing this?

Thanks in advance.


回答1:


The recommended way is to make Lock Screen Widgets. These are widgets that allow you to interact with apps in the lockscreen such as the Google Play Music app.

Check out the official tutorial here:

http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen



来源:https://stackoverflow.com/questions/16434471/android-recognising-gestures-when-screen-is-locked

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