Save photo URI

This commit is contained in:
M66B 2019-09-08 17:44:18 +02:00
parent 4f48fb417e
commit 94f3f05d0f
1 changed files with 3 additions and 0 deletions

View File

@ -683,6 +683,7 @@ public class FragmentCompose extends FragmentBase {
public void onSaveInstanceState(Bundle outState) {
outState.putLong("fair:working", working);
outState.putBoolean("fair:show_images", show_images);
outState.putParcelable("fair:photo", photoURI);
super.onSaveInstanceState(outState);
}
@ -730,6 +731,7 @@ public class FragmentCompose extends FragmentBase {
} else {
working = savedInstanceState.getLong("fair:working");
show_images = savedInstanceState.getBoolean("fair:show_images");
photoURI = savedInstanceState.getParcelable("fair:photo");
Bundle args = new Bundle();
args.putString("action", working < 0 ? "new" : "edit");
@ -981,6 +983,7 @@ public class FragmentCompose extends FragmentBase {
dir.mkdir();
File file = new File(dir, new Date().getTime() + ".jpg");
// https://developer.android.com/training/camera/photobasics
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
photoURI = FileProvider.getUriForFile(getContext(), BuildConfig.APPLICATION_ID, file);
intent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);