I wrote this code to open the front camera on the surface, on the screen, but when you press the button, I want to record video with the front camera.
This code failure. I used two different variables for the cameras, but I did not find my mistake :( .. I followed the Google manual.
public class MainActivity extends Activity { public static final int MEDIA_TYPE_VIDEO = 2; private Camera mCamera; private CameraPreview mPreview; public static final int MEDIA_TYPE_IMAGE = 1; protected static final String TAG = null; private MediaRecorder mMediaRecorder; private Camera mCamerafront; private boolean isRecording = false; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main);
source share