手机助手访问:程序的图标;

来源:互联网 发布:c语言数据类型所占字节 编辑:程序博客网 时间:2024/05/01 17:42

手机助手访问:程序的图标;

源码:
  clean.setFilepath(Environment.getExternalStorageState()+cursor.getString(4));        File file=new File (clean.getFilepath());        Drawable icon=null;         try {            icon=getPackageManager().getApplicationIcon(clean.getApkname());        } catch (NameNotFoundException e) {            // TODO 自动生成的 catch 块            e.printStackTrace();        }         icon=getResources().getDrawable(R.drawable.icon_video);           clean.setIcon(icon);

getResources().getDrawable(R.drawable.icon_video)– 引用resource中的资源getResource方法进行应用

0 0