找回密码
 立即注册
Theresource资源Activity | android开发 2022-11-24 62 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
Android将Activity打包成jar包供第三方调用,代码的核心是MResource这个类,使用反射依据资源名称获取资源ID(其实系统也自带了依据资源名称获取资源ID的方法getResources().getIdentifier(main_activity,layout,getPackageName());第一个参数是资源的名称,第二个参数是资源的类型,例如layout,string等,第三个是包名称)。

(Android packages activities into jar packages for third parties to call. The core of the code is the MResource class, which uses reflection to obtain resource IDs based on resource names (in fact, the system also has its own method getResources() to obtain resource IDs based on resource names getIdentifier(main_activity,layout,getPackageName()); The first parameter is the name of the resource, the second parameter is the type of the resource, such as layout, string, etc., and the third parameter is the package name).)

[下载]15132789499.rar




上一篇:Android API人脸检测源码实例
下一篇:Android开源项目SlidingMenu动画效果源代码