0

I built my own camera so it could be launched from inside my other android app, i want to save the images inside this app and not in the default gallery, i was using getExternalFilesDir() because i wanna keep the data just inside my app. But it is not working quite right, does anybody know what i have to change?? I do have the permission in my manifest. My phone is an HTC phone

private void dispatchTakePictureIntent(int actionCode) {

    imageURI = getExternalFilesDir(null) + File.separator
            + System.currentTimeMillis() + ".jpg";

    File mFile = new File(getFilesDir(), "newImage.jpg");
    if(!mFile.exists()) {
        try{
            mFile.createNewFile();
        } catch (Exception e){
            return;
        }
    }

    //Uri iURI = Uri.parse(imageURI);
    Log.v("camera", mFile.toString()); // Debugging statement
    Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(mFile));
    startActivityForResult(takePictureIntent, actionCode);

}

Here is the code that i am using to do it.

4

1 回答 1

0

要从图库中隐藏图像,您应该在包含图像的文件夹中创建 .nomedia 文件,或者创建自己的相机应用程序。

于 2013-04-05T14:40:04.740 回答