int count=1;
if(block=="other(from camera)")
{
final String dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/picFolder/";
File newdir = new File(dir);
newdir.mkdirs();
int TAKE_PHOTO_CODE = 0;
count++;
file = dir+count+".jpg";
File newfile = new File(file);
try
{newfile.createNewFile();}
catch (IOException e) {}
Uri outputFileUri = Uri.fromFile(newfile);
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(cameraIntent, TAKE_PHOTO_CODE);
这是拍摄照片并将其保存到图库的代码。我想使用正在存储的图像。但不幸的是,每次关闭应用程序并重新打开它时,图片都会从2开始.jpeg。有一种方式可以让照片在重新打开应用程序后继续拍摄。