I can’t do auto photography with a given number of photos. If you use the onClick method for a photo and press several times - everything is in order, but putting the code in a for loop, even using a handler, an error occurs, and the folder is empty. One of many tested options:
final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { for (int i=0; i<5; i=i+1){ .... тут кусок задаёт имя и положение нового фото .... camera.takePicture(null, null, null, MainActivity.this); SystemClock.sleep(5000); // паузы для фото на всякий пожарный. } } }, 5000); PS The code above is greatly simplified, naturally there is onPictureTaken and others, just as the place of the problem itself, the real code is more complicated with the use of the new name for each photo in separate classes ... I obviously don’t know something, but I don’t know what.