I have to record video for a specified time duration.
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,
Uri.fromFile(videoTempFile));
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, videoRecordDuration);
startActivityForResult(intent, CAPTURE_VIDEO_ACTIVITY_REQUEST_CODE);
videoRecordDuration has value 60 seconds. The above code will open default device camera with image capture and video recording option. If the user did not select any of this and keep the device idle with camera opened. After 60 seconds the app exited camera app and returned to my application. How to count down MediaStore.EXTRA_DURATION_LIMIT
if and only if user select either camera or video using default camera app?