无法结束的Android 2.2.6 verstion电话 [英] unable to end call in android verstion 2.2.6
本文介绍了无法结束的Android 2.2.6 verstion电话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用下面的方法来E要结束通话
i trying to end call using below method to e
private void getTeleService(Context context) {
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
com.android.internal.telephony.ITelephony telephonyService = (ITelephony) m.invoke(tm);
telephonyService.silenceRinger();
telephonyService.endCall();
} catch (Exception e) {
e.printStackTrace();
Log.e("","FATAL ERROR: could not connect to telephony subsystem");
Log.e("", "Exception object: " + e);
}
}
这工作正常了Android 2.2版本,但无法结束Android版本2.2.6通话
我不知道自己做错了什么在这个code。
this working fine with android version 2.2 but unable to end call in android version 2.2.6 i don't know what wrong in this code.
我得到了解决,我只是注释掉该行telephonyService.silenceRinger();
因为这种方法不支持上面的Android 2.3版本
i got the solution i just comment out this line telephonyService.silenceRinger(); because this method is not support above android 2.3 version
请帮我
感谢进阶
please help me thanks in adv.
推荐答案
的Android改为2.2后,这些技巧非再工作
Android was changed after 2.2, these tricks non longer work
这篇关于无法结束的Android 2.2.6 verstion电话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文