Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 把gallary和我的相机联系起来_Android_Camera_Gallery - Fatal编程技术网

Android 把gallary和我的相机联系起来

Android 把gallary和我的相机联系起来,android,camera,gallery,Android,Camera,Gallery,我制作了一个自定义相机应用程序,但我想将保存在文件夹中的照片链接到图库。我应该如何链接它? 我的代码是: private void onFileClick2(Option o) { Toast.LENGTH_SHORT).show(); Toast.makeText(this, "File Clicked: "+f.getPath(), Toast.LENGTH_SHORT).show(); Intent imageInte

我制作了一个自定义相机应用程序,但我想将保存在文件夹中的照片链接到图库。我应该如何链接它? 我的代码是:

     private void onFileClick2(Option o)
     {
    Toast.LENGTH_SHORT).show();
    Toast.makeText(this, "File Clicked: "+f.getPath(),         
    Toast.LENGTH_SHORT).show();
     Intent imageIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
     Calendar c = Calendar.getInstance();
     int seconds = c.get(Calendar.DATE);
     Random r = new Random();
     int i1 = r.nextInt();
     File image = new File(f.getPath()+"/"+"picture"+String.valueOf(i1)+".jpg");
     Uri uriSavedImage = Uri.fromFile(image);
     imageIntent.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage);

    startActivityForResult(imageIntent , 1337);
    fill(f);
}

我猜你忘了问这个问题谢谢我完全忘了。。。