Advertisement
ms_olin

Untitled

May 7th, 2017
1,870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. @Override
  2.     protected void onDestroy() {
  3.         super.onDestroy();
  4.     }
  5.  
  6.     @Override
  7.     protected void onPause() {
  8.         super.onPause();
  9.  
  10.         // on pause turn off the flash
  11.         turnOffFlash();
  12.     }
  13.  
  14.     @Override
  15.     protected void onRestart() {
  16.         super.onRestart();
  17.     }
  18.  
  19.     @Override
  20.     protected void onResume() {
  21.         super.onResume();
  22.  
  23.         // on resume turn on the flash
  24.         if(hasFlash)
  25.             turnOnFlash();
  26.     }
  27.  
  28.     @Override
  29.     protected void onStart() {
  30.         super.onStart();
  31.  
  32.         // on starting the app get the camera params
  33.         getCamera();
  34.     }
  35.  
  36.     @Override
  37.     protected void onStop() {
  38.         super.onStop();
  39.  
  40.         // on stop release the camera
  41.         if (camera != null) {
  42.             camera.release();
  43.             camera = null;
  44.         }
  45.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement