try {
Class clazz = this.getClass().getClassLoader()
.loadClass("android.widget.AppSecurityPermissions");
Constructor constructor = clazz.getConstructor(new Class[] {
Context.class, String.class });
Object object = constructor.newInstance(new Object[] { this,
"cn.itcast.mobilesafe" });
Method method = clazz.getDeclaredMethod("getPermissionsView",
new Class[] {});
View view = (View) method.invoke(object, new Object[] {});
setContentView(view);
} catch (Exception e) {
e.printStackTrace();
}
android中通过"反射"的到android隐藏的API
最新推荐文章于 2023-04-08 12:12:47 发布