我正在做一个应用程序,prevents呼叫某些联系人的用户。我在一个数据库中的联系人,但我不知道在哪里后去。我知道,我必须使用广播接收器,并允许在清单中,但比我卡等。
I'm working on making an app that prevents the user from calling certain contacts. I have the contacts in a database but I don't know where to go after that. I know that I must use a broadcast receiver and permission in the manifest but other than that I'm stuck.
这解释了如何做到这一点:http://groups.google.com/group/android-developers/browse_thread/thread/931e04811839326e
This explains how to do it: http://groups.google.com/group/android-developers/browse_thread/thread/931e04811839326e
的要点是,你需要使用 BroadcastReciever
拦截 NEW_OUTGOING_CALL
的意图,但要确保设定你的意图过滤器的优先级为-1。要中止呼出电话,你就需要调用 setResultData(空);
从 BroadcastReceiver.onReceive(上下文,意图)返回前
(其中prevents意图下游处理从处理呼出电话)。
The gist is that you need to use a BroadcastReciever
to intercept the NEW_OUTGOING_CALL
intent, but making sure to set the priority of your intent filter to -1. To abort the outbound call, you'll need to call setResultData(null);
before returning from BroadcastReceiver.onReceive(Context, Intent)
(which prevents downstream handlers of the intent from processing the outbound call).
上一篇:.NET的正则表达式字母和空格空格、字母、正则表达式、NET
下一篇:Visual Studio 2010的.NET Framework 3.5的不可用不可用、Studio、Visual、Framework