获取ITelephony 对象

Method method = null;
IBinder binder = null;
try {
method = Class.forName("android.os.ServiceManager").getMethod("getService", String.class);
binder = (IBinder) method.invoke(null, new Object[]{Context.TELEPHONY_SERVICE});
} catch (Exception e) {
Log.e(TAG, "Error msg:" + e);
}
ITelephony mTelephony = ITelephony.Stub.asInterface(binder);

转载于:https://www.cnblogs.com/rose-jeff/p/9083848.html

你可能感兴趣的:(获取ITelephony 对象)