0

I have two Activities. WebViewActivity and CameraPreviewActivity

I should be able to switch between the two activities on click of a button. Once I have started CameraPreviewActivity, further loads of the activity should not take much time to initialize the camera view. It should be like its getting resumed from previous state.

Is it a good idea to do this by keeping the launch mode of both activities as 'Single Instance' and start the activities when the respective button is clicked?

arjoan
  • 1,849
  • 2
  • 20
  • 39

1 Answers1

0

Is it a good idea to do this by keeping the launch mode of both activities as 'Single Instance' and start the activities when the button is clicked

Yes, mark their LaunchMode as SingleInstance in Manifest, also do not call finish() method in any of them. This will call the activity which is already there in stack.

AAnkit
  • 27,299
  • 12
  • 60
  • 71