解决方案 »
- Android里面的handler怎么知道将Message对象发送给哪个线程的Looper啊?
- 不用XML来进行布局的开发真吐血,无法把摁钮放到我想放的地方
- android 新浪微博客户端开发
- 在线等,一个 Run Configuration问题
- 请教大家一个android文件的问题
- Arcgis for android 如何重写TiledServiceLayer
- android如何实现静默安装哦
- checkBox和radiobutton显示问题
- 如何获取下面信息中的指定某个值?
- Android工程中bin目录下为什么.apk文件是空的???
- 如何替换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);
}
}
}