Advertisement
ms_olin

Untitled

May 7th, 2017
1,917
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.93 KB | None | 0 0
  1. package com.panelic.flashlight;
  2.  
  3. import android.app.Activity;
  4. import android.app.AlertDialog;
  5. import android.content.DialogInterface;
  6. import android.content.pm.PackageManager;
  7. import android.os.Bundle;
  8. import android.util.Log;
  9. import android.view.View;
  10. import android.widget.ImageButton;
  11. import android.hardware.Camera;
  12. import android.hardware.Camera.Parameters;
  13. import android.media.MediaPlayer;
  14. import android.media.MediaPlayer.OnCompletionListener;
  15.  
  16. public class MainActivity extends Activity {
  17.  
  18.     ImageButton btnSwitch;
  19.  
  20.     private Camera camera;
  21.     private boolean isFlashOn;
  22.     private boolean hasFlash;
  23.     Parameters params;
  24.     MediaPlayer mp;
  25.  
  26.     @Override
  27.     protected void onCreate(Bundle savedInstanceState) {
  28.         super.onCreate(savedInstanceState);
  29.         setContentView(R.layout.activity_main);
  30.  
  31.         // flash switch button
  32.         btnSwitch = (ImageButton) findViewById(R.id.btnSwitch);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement