0

In USB camera supported android application.

I will make the app to go background when usb camera is connected. when the app is in background, i will disconnect the camera from the device. Next I will re-launch the app from background. After relaunch I would like to know that the camera got disconnected.

Is there any way to know in my activity or fragment when the camera got disconnected in background?

Pushpa
  • 892
  • 1
  • 12
  • 30

1 Answers1

0

For saving/recreating activity state read this:

http://developer.android.com/training/basics/activity-lifecycle/recreating.html

It also explains more about activity lifecycle.

Same can be achieved for fragments (lifecycle):

http://developer.android.com/reference/android/app/Fragment.html

Kenan Begić
  • 1,228
  • 11
  • 21