
public class CallBlockReceiver extends broadcastReceiver{ @OverrIDe public voID onReceive(Context context,Intent intent) { // Todo auto-generated method stub } private voID getTeleService(Context context) { TelephonyManager tm = (TelephonyManager) context .getSystemService(Context.TELEPHONY_SERVICE); try { // Java reflection to gain access to TelephonyManager's // ITelephony getter Log.v("","Get getTeleService..."); 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); } catch (Exception e) { e.printstacktrace(); Log.e("","Fatal error: Could not connect to telephony subsystem"); Log.e("","Exception object: " + e); }}} 请帮我 .
解决方法 你在项目中添加了ITelephony.AIDL文件?如果你已经添加,那么你的包名必须是com / androID / internal / telephony / ITelephony.AIDL:有关更多信息 Blocking Incoming call.从 here下载AIDL文件 总结
以上是内存溢出为你收集整理的如何在android中解决此错误“com.android.internal.telephony无法解析为类型”全部内容,希望文章能够帮你解决如何在android中解决此错误“com.android.internal.telephony无法解析为类型”所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)