小编Twi*_*赵汝鹏的帖子

Android's camera doesn't go back to my app when photo has been taken

It even can't make a folder on the sdcard. When the camera takes the photo, it doesn't respond when I press the 'OK' Button. What's wrong with my code?

public static final String MACCHA_PATH = Environment.getExternalStorageDirectory().getPath() + "/Twigit";
public static final String PHOTO_PATH = MACCHA_PATH + "/camera.jpg";

public static boolean takePhoto(Activity activity) {
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    File fileDir = new File(MACCHA_PATH);
    boolean isSuccessful = true;
    if (!fileDir.exists()) {
        isSuccessful = fileDir.mkdir();
    }
    if(!isSuccessful) {
        return false;
    } else …
Run Code Online (Sandbox Code Playgroud)

camera android

5
推荐指数
1
解决办法
1661
查看次数

标签 统计

android ×1

camera ×1