android start camera activity on application launch or while brought to frontr

Go To StackoverFlow.com

0

I need to start camera activity when my application is started or taken from background. How to detect it?

2012-04-04 20:05
by cubesoft


0

Take a look at the Android activity lifecycle and you will see that overriding the onResume method in your activity so that it launches the camera intent will accomplish what you need.

Note that if you do it this way you'll likely end up in the situation where you will be constantly launching the camera whenever your activity resumes and cannot exit your application (unless you are handling that in the onActivityResult from launching the camera)

2012-04-04 20:16
by dymmeh
Ads