一个小工具类

package com.listviewtest;import android.content.Context;/** * 获取资源文件识别码 */public class IdentifierUtil {public static int getIdentifier(Context context, String type, String payId) {String packageName = context.getPackageName();return context.getResources().getIdentifier(payId, type, packageName);}public static int getDrawableIdentifier(Context context, String payId) {return getIdentifier(context, "drawable", payId);}public static int getStyleIdentifier(Context context, String payId) {return getIdentifier(context, "style", payId);}}

更多相关文章

  1. android实现文件读写功能
  2. Android 本地文件上传到服务器
  3. android--------根据文件路径加载指定文件
  4. android用于打开各种文件的intent,包括以下文件PDF,PPT,WORD,EXC
  5. android 删除sdcard中文件命令
  6. android 不能安装超过600MB文件?
  7. [android]寫一個system/bin 下的可執行文件

随机推荐

  1. android 中判断有无网络连接
  2. android中修改默认语言
  3. Linux Kernel(Android) 加密算法总结(二)-
  4. Android所有系统资源图标android.R.drawa
  5. android -sdcard
  6. android获取当前窗口的宽度和高度
  7. android 获取屏幕宽高、view宽高
  8. Android SystemServer
  9. Android 两个Activity切换时回调函数调用
  10. Android客户端GPS定位源码