我的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