如何在android中解决此错误“com.android.internal.telephony无法解析为类型”

我正在创建简单的呼叫过滤应用程序,限制不必要的呼我使用以下代码来限制调用,但我无法在下面的代码中解决此行的问题“com. android.internal.telephony.ITelephony telephonyService =(ITelephony)m.invoke(tm);”它显示错误消息com. android.internal.telephony无法解析为android中的某个类型如何解决此错误.
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性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...