赞
踩
startActivityForResult(in, REQUEST_CALENDAR);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(data == null ){
return;
}
if (requestCode == REQUEST_CALENDAR) {
String path=Uri.decode(data.getDataString());
Uri uri = Uri.parse(path);
path = Tool.getPathFromUri(mactivity, uri);
AppLog.d("dingdong", "path========="+path);
}else if(requestCode == REQUEST_FILE){
String path=Uri.decode(data.getDataString());
if(!MediaFile.isVideoFileType(path)){
Uri uri = Uri.parse(path);
path = Tool.getPathFromUri(mactivity, uri);
}
if(path!=null&&!"".equals(path)){
if(path.startsWith("file://")){
int position = path.indexOf("/")+2;
AppLog.d("dingdong", "position === "+position);
path = path.substring(position);
}
}
AppLog.d("dingdong", "path========="+path);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。