I have a button in my app. With an OnClick event to the button I launch the default camera app.
public void startrec(View v) {
Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
startActivity(intent);
}
This works fine. Now is it possible that the camera starts recording automatically without I have to press the record button in the camera application? So I mean... I press my button in my app -> the camera app starts -> the record starts immediately
How can I do that?
How can I do that?
Record the video yourself, using classes like MediaRecorder
.
Your existing code is asking a third-party app to take a video on your behalf. There are hundreds, perhaps thousands, of such apps. The behavior of each of those is up to the developer of those apps. There are no documented extras for your chosen Intent
action, let alone one for your desired feature. And even if it existed, not every camera app would honor it.