Skip to content
Snippets Groups Projects
Unverified Commit 75b0eeb6 authored by i-robot's avatar i-robot Committed by Gitee
Browse files

!3171 [MS][LITE][DOC]The style transfer demo, save and camera button not working functional.

Merge pull request !3171 from HuKang/master
parents a6d72926 eb1733dd
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
package com.mindspore.imagesegmentation;
import android.Manifest;
import android.content.ContentValues;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
......@@ -173,8 +174,7 @@ public class MainActivity extends AppCompatActivity implements OnBackgroundImage
private void openCamera() {
Intent intentToTakePhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String mTempPhotoPath = Environment.getExternalStorageDirectory() + File.separator + "photo.jpeg";
imageUri = FileProvider.getUriForFile(this, getApplicationContext().getPackageName() + ".fileprovider", new File(mTempPhotoPath));
imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues());
intentToTakePhoto.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intentToTakePhoto, RC_CHOOSE_CAMERA);
}
......
......@@ -16,6 +16,7 @@
package com.mindspore.styletransferdemo;
import android.Manifest;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
......@@ -212,8 +213,7 @@ public class MainActivity extends AppCompatActivity implements OnBackgroundImage
private void openCamera() {
if (isAllGranted) {
Intent intentToTakePhoto = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String mTempPhotoPath = Environment.getExternalStorageDirectory() + File.separator + "photo.jpeg";
imageUri = FileProvider.getUriForFile(this, getApplicationContext().getPackageName() + ".fileprovider", new File(mTempPhotoPath));
imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues());
intentToTakePhoto.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
startActivityForResult(intentToTakePhoto, RC_CHOOSE_CAMERA);
} else {
......
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