android中通过"反射"的到android隐藏的API
16lz
2022-03-31
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();}
参考
参考2
参考3
更多相关文章
- android surfaceView参考
- Android(安卓)WebView 图片自适应屏幕宽度
- Android(安卓)显示网页图片
- Android如何将第三方信息应用设置为默认信息应用?
- Android: 如何实现 in_app purchase
- PHP 即将来到 Google Android?
- 澄迈NIIT Android(安卓)实训 后5天学习android的基础
- android将后台应用置顶及moveTaskToFront的用法
- android 7.1.1 开始 Prevent apps to overlay other apps via to