解决方案 »
- C compiler cannot create executables
- webview 返回上一页了,但前面的视频还在播放怎么才能给他关掉?
- 人人客户端从左侧滑出效果
- 怎么做“进入界面显示上次发表的内容”?求高手帮忙
- 关于自定义的view和各类GroupView有点疑问。。。
- 如何实现在屏幕中使气泡可以自由移动而又不互相重叠
- 如何统计android软件的安装和卸载次数
- android 错误谁帮我看看(做过刀锋效果的 也可以进来)
- 请教高手,有没办法在class里面连续销毁几个actity ?
- android 系统权限
- 如何替换Android模拟器 system/lib/和system/bin/下面的文件
- 关于“Xamarin”的几个问题?
Cursor cursor = managedQuery(photoUri, pojo, null, null,null);
photoUrl空指针报错后再点拍照上传,就不报错了
你可以试一下下面这种方式,把照片存放的文件发过去,然后返回后直接用
private void dispatchTakePictureIntent() {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
// Ensure that there's a camera activity to handle the intent
if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
// Create the File where the photo should go
File photoFile = null;
try {
photoFile = createImageFile();
} catch (IOException ex) {
// Error occurred while creating the File
...
}
// Continue only if the File was successfully created
if (photoFile != null) {
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT,
Uri.fromFile(photoFile));
startActivityForResult(takePictureIntent, REQUEST_TAKE_PHOTO);
}
}
}