1、通过R.drawable.**来获取文件的路径
     

protected static String getAbsoluteImagePath(Context context, Uri uri)  {
// can post image
String [] proj={MediaStore.Images.Media.DATA};
Cursor cursor = context.getContentResolver().query( uri,
proj, // Which columns to return
null, // WHERE clause; which rows to return (all rows)
null, // WHERE clause selection arguments (none)
null); // Order-by clause (ascending by name)

int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();

return cursor.getString(column_index); }
Resources r =  app.getApp().getApplicationContext().getResources(); Uri uri =  Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"    + r.getResourcePackageName(R.drawable.favorite_detail_line) + "/"    + r.getResourceTypeName(R.drawable.favorite_detail_line) + "/"    + r.getResourceEntryName(R.drawable.favorite_detail_line)); String headLineString = getAbsoluteImagePath(app.getApp().getApplicationContext(), uri);

2、获取到表情路径的方法
     

Drawable d = EmoWindow.getDrawable(app.getApp(), app.getApp().getResources().getDisplayMetrics().density, i); if(d != null){           String filepath = "";            try { URLDrawable ud = (URLDrawable)d; if (ud.hasDiskCache()) { filepath = ud.getDiskCache().getAbsolutePath(); } } catch (Exception e) {  e.printStackTrace();     } }

更多相关文章

  1. Android将bitmap保存到自定义路径
  2. android 根据SD卡中图片路径读取并显示SD中的图片――源代码
  3. android读取SDCard任意路径下的文件
  4. Android之adt 23找不到NDK路径设置解决方案
  5. Android 模拟器中AVD路径的修改
  6. Android各版本 内外卡真实路径
  7. AVD(android virtual device)路径设置
  8. APK安装路径移动至外部存储设备
  9. android实现图片按任意路径截取

随机推荐

  1. Android(安卓)震动功能
  2. android 退出整个APP
  3. Android(安卓)Button使用,ArrayList使用练
  4. android 自定义View 滚动选择器PickerVie
  5. android左右滑动翻页查看图片
  6. Android读写文件示例
  7. android custom viewgroups 性能分析
  8. Android(安卓)valueAnimator和ObjectAnim
  9. Android中Broadcast的Intent大全
  10. Android涂鸦