sdcard上的文件如何转换成ContentProvider格式供其它功能使用? 本帖最后由 woshiwo1427 于 2011-09-06 12:23:12 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 沙发自己抢,肥水不留外人田!过去回1张贴就气喘吁吁,现在用了《Csdn收音机》,一口气回5张贴不费劲! 如下所示,自定义一个FileProvider:public class FileProvider extends ContentProvider {///... } @Override public ParcelFileDescriptor openFile(Uri uri, String mode)throws FileNotFoundException { File f=new File(getContext().getFilesDir(), uri.getPath()); if (f.exists()) { return(ParcelFileDescriptor.open(f,ParcelFileDescriptor.MODE_READ_ONLY)); } throw new FileNotFoundException(uri.getPath()); } Android蓝牙开发遇到的问题!!!!跪求大神帮忙 菜鸟关于与入门书籍的请教 View Canvas android图形画座位思路 public 和 private 哪个更省内存,都可用的时候,用哪个? 各位大牛,Camera模块预览界面size的问题 Android老油条请进 android配置问题? android 微信分享时 api.sendReq(req);返回的为ture,但是无法跳转到微信页面,是为什么??? 求大神指点!!!!! android如何实现远程控制PC端鼠标的——————跪求 android xml的问题,求指点
///... }
@Override
public ParcelFileDescriptor openFile(Uri uri, String mode)throws FileNotFoundException {
File f=new File(getContext().getFilesDir(), uri.getPath());
if (f.exists()) {
return(ParcelFileDescriptor.open(f,ParcelFileDescriptor.MODE_READ_ONLY));
}
throw new FileNotFoundException(uri.getPath());
}