创建的文件夹不能使用照相机拍照

我用的下面的代码,我不想把图像储存在 SDCard 中,获得异常说不能找到文件和目录。大家给点提示,哪里出错呢?

case 0:
        Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
        try {
           photo = this.createTemporaryFile("Temp", ".jpg");
           intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photo));
        } catch(Exception e) {
           Log.v("Error", "Can't create file to take picture!");
           break;
        }
        startActivityForResult(intent, RESULT_CAMERA_SELECT);
        break;
  case 1: 
        intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        startActivityForResult( intent, RESULT_MEMORY_SELECT );
        break;
  default:
        break;
        }
   }
    private File createTemporaryFile(String part, String ext) throws Exception
    {
        File tempDir= Environment.getRootDirectory();
        tempDir=new File(tempDir.getAbsolutePath()+"/.temp/");
        if(!tempDir.exists())
        {
            tempDir.mkdir();
        }
        return File.createTempFile(part, ext, tempDir);
    }

你获取到root目录下创建文件夹的权限了吗?