屏幕锁定时使用音量键
总的来说,我是编程的初学者。我什至不知道如何开始寻找这样的东西。我想做的是制作一个简单的、有价值的文本应用程序。主要是我想数一下我钓到了多少条鱼。我希望能够在屏幕锁定时使用音量摇杆来计算我捕获了多少条鱼。我还没有开始使用该应用程序,所以我没有任何代码要发布。如果有人能指出我正确的方向,那就太好了。提前致谢。
I'm a beginner at programming in general. I don't even know how to begin to search for something like this. What i want to do is make a simple text app that counts. Mainly i want to count how many fish i catch. I want to be able to use the volume rocker when the screen is locked to count how many fish i catch. I haven't started on the app yet, so i don't have any coding to post. If someone can point me in the right direction, that would be wonderful. Thanks in advanced.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此代码将开始侦听音量按钮按下情况。我想如果您想在屏幕关闭时执行此操作,则必须获得某种唤醒锁,该唤醒锁可以让屏幕关闭但仍保持应用程序运行。
This code will get started listening for the volume button presses. I imagine if you want to do it while the screen is off you'll have to acquire some kind of wakelock that lets the screen shut off but still keeps your app running.