我的VoiP客户端希望在我自己的通话发生时阻止所有来电。以某种方式可以做到这一点吗?阻止来电
Q
阻止来电
3
A
回答
1
与当前SDK没有,您可以监控来电,并给用户提供应用程序,而不是本机应用程序
4
是可以阻止来电接听选项。使用此代码
String phonestate = bundle.getString(TelephonyManager.EXTRA_STATE);
try
{
if (TelephonyManager.EXTRA_STATE_RINGING.equalsIgnoreCase(phonestate))
{
try
{
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (com.android.internal.telephony.ITelephony) m.invoke(tm);
}
catch (Exception e)
{
e.printStackTrace();
}
if (prefStatus != null)
{
if (count == 1)
{
telephonyService.endCall();
String prefLoginemail = myloginpref.getString("emailid", null);
System.out.println(printdata + " prefLoginemail :: "+ prefLoginemail);
Global.mNotificationManager = (NotificationManager) mxcontext.getSystemService(Context.NOTIFICATION_SERVICE);
notifyDetails = new Notification(com.CellPhoneTerror.R.drawable.icon1,"CellPhoneTerror!", System.currentTimeMillis());
myIntent = PendingIntent.getActivity(mxcontext, 0, new Intent(mxcontext, clsHomePage.class), 0);
notifyDetails.setLatestEventInfo(mxcontext,"You Got a Call from Blocked Number.", "",myIntent);
notifyDetails.flags |= Notification.FLAG_AUTO_CANCEL;
Global.mNotificationManager.notify(Global.SIMPLE_NOTFICATION_ID,notifyDetails);
}
}
}
if (prefIncomingBlock.equals("true"))
{
if (TelephonyManager.EXTRA_STATE_IDLE.equalsIgnoreCase(phonestate))
{
if (count == 0)
{
System.out.println("if Cellphoneterror:"+ Global.clsIncomingNum);
Intent block = new Intent(context, dialogbox1.class);
block.setFlags(intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(block);
}
}
}
}
catch (Exception e)
{
e.printStackTrace();
}
谢谢。
相关问题
- 1. 阻止来电 - Android电子
- 2. Android中的来电阻止
- 3. 阻止黑莓的来电
- 4. 我如何阻止来电?
- 5. 阻止来电在WP 7
- 6. 阻止来电与系统服务
- 7. IOS - 如何阻止所有来电?
- 8. 立即在Android中阻止来电
- 9. 在Android异常来电阻止
- 10. 如何在来电时阻止音乐?
- 11. 如何在Twilio拨打电话时阻止来电铃声
- 12. 麻烦来完成关于来电阻止的应用程序
- 13. 阻止或阻止临时电子邮件地址域
- 14. 阻塞来电android系统
- 15. ShowDialog无阻塞来电
- 16. 如何阻止来自“正在打电话的家庭”的SSIS
- 17. Blackberry - 如何以编程方式取消阻止来电者Id
- 18. 阻止黑莓并删除未接来电通知
- 19. 如何阻止来电关闭我的程序?
- 20. 阻止来自电子邮件邀请的粗俗术语
- 21. 阻止UI线程但保持处理来电
- 22. 我是否可以阻止来电打开屏幕?
- 23. 在部分响铃之前阻止来电
- 24. 如何在切换小部件打开时阻止来电?
- 25. 如何以编程方式阻止来自未知号码的来电?
- 26. 以编程方式阻止来自iOS应用程序的来电显示
- 27. 电子阻止主窗口关闭
- 28. 电子邮件标题阻止链接?
- 29. Android。在启动时阻止电话
- 30. 阻止传入和传出的电话?
用户如何选择应用程序来回答,通过intentchooser?感谢您的帮助。 – pgsandstrom 2010-02-26 12:49:43
是的,你可以注册听取该意图,并启动你的应用程序 – 2010-02-26 13:50:11