Professional Documents
Culture Documents
fregments
fregments
import android.os.Bundle; // Import the Bundle class from the android.os package
import android.content.Context; // Import the Context class from the android.content package
import android.hardware.camera2.CameraAccessException; // Import the CameraAccessException
class from the android.hardware.camera2 package
import android.hardware.camera2.CameraManager; // Import the CameraManager class from the
android.hardware.camera2 package
Mainactivity.java
// Import necessary packages and classes
package com.example.flashlight;
import android.os.Bundle; // Import the Bundle class from the android.os package
import android.content.Context; // Import the Context class from the android.content package
import android.hardware.camera2.CameraAccessException; // Import the CameraAccessException
class from the android.hardware.camera2 package
import android.hardware.camera2.CameraManager; // Import the CameraManager class from the
android.hardware.camera2 package
// Define the MainActivity class, which extends AppCompatActivity
public class MainActivity extends AppCompatActivity {