Commit f3a20ac4 by sikang

bug fix

parent 995937d9
...@@ -103,6 +103,11 @@ public class TakePhotoActivity extends BaseActivity { ...@@ -103,6 +103,11 @@ public class TakePhotoActivity extends BaseActivity {
} }
File file = BitmapUtils.saveBitmapToSDCard(bitmap, image, 100); File file = BitmapUtils.saveBitmapToSDCard(bitmap, image, 100);
if(file==null){
setResult(RESULT_CANCELED);
finish();
return;
}
//如果图片过大,则压缩 //如果图片过大,则压缩
long size=FileUtils.getFileSize(file)/1024; long size=FileUtils.getFileSize(file)/1024;
if (FileUtils.getFileSize(file) / 1024 > 1024) { if (FileUtils.getFileSize(file) / 1024 > 1024) {
......
...@@ -124,7 +124,7 @@ public class FragmentLauncher { ...@@ -124,7 +124,7 @@ public class FragmentLauncher {
listener.onFragmentCreated(fragment); listener.onFragmentCreated(fragment);
} }
//提交 //提交
transaction.commit(); transaction.commitAllowingStateLoss();
return fragment; return fragment;
} }
......
...@@ -86,7 +86,9 @@ public class PermissionsHelper { ...@@ -86,7 +86,9 @@ public class PermissionsHelper {
* 摄像头权限 * 摄像头权限
*/ */
public static void checkCameraPermission(FragmentActivity activity, OnPermissionListener listener) { public static void checkCameraPermission(FragmentActivity activity, OnPermissionListener listener) {
checkPermission(activity, CAMERA, listener); if (activity != null) {
checkPermission(activity, CAMERA, listener);
}
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment