如何使广播接收机捕获(菜单,音量,家庭.......)按钮点击? [英] how to make a broadcast receiver catch ( menu, volume, home....... ) button click?

查看:191
本文介绍了如何使广播接收机捕获(菜单,音量,家庭.......)按钮点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想上点击(菜单,卷或任何其他可能的按钮)时要调用我的广播接收机。

i want my broadcast receiver to be invoked when clicking on(menu, volume or any other possible button).

这是可能的?请帮我

问候

推荐答案

是的,它是可能的,但不要浪费你的时间来建立一个应用程序,它是基于菜单按钮(硬件按钮的HTC手机)一些手机唐'T支持菜单按钮,而不是他们提供触摸LG等手机。

Yes it is possible but don't waste your time to build an application, which is based upon menu button(hardware buttons like HTC phones) as some phones don't support menu buttons instead they offer you touch like LG phones.

您可以向上和向下添加功能,电源键,音量按钮。

You can add functionality to Power button, Volume Buttons Up and Down.

下面是一个新手教程适合你。

Here is the tutorial for you as a newbie.

http://www.vogella.com/articles/AndroidBroadcastReceiver/article.html

我会建议你开始之前,研究广播接收器详细写你的code!

I will recommend you to study Broadcast Receiver in detail before start writing your code!

最后一件事,做研究API 10或低于10和API 11或更高版本之间的差别,因为当你在API 11或更高版本上运行你的API基于10 Android应用程序出现了问题。

One last thing, do Study the differences between API 10 or lower and API 11 or higher, Because there arises a problem when you run you API 10 based Android App on API 11 or higher.

另请参见,
- 待定意图
- sendBroadcast()

Also See, - Pending Intents - sendBroadcast()

这篇关于如何使广播接收机捕获(菜单,音量,家庭.......)按钮点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆