If my gradle file has:
minSdkVersion 15
targetSdkVersion 22
But my Fragment.java file, underlines the Camera word. Am I doing anything wrong? If I use Camera2 it comes as an error, and highlights it as red.
If my gradle file has:
minSdkVersion 15
targetSdkVersion 22
But my Fragment.java file, underlines the Camera word. Am I doing anything wrong? If I use Camera2 it comes as an error, and highlights it as red.
Camera2 is added in API level 21. Your app will crash on devices with api levels 15-20. Use old Camera API.
The camera2 package was added in API level 21 to replace the old camera package. As you are targeting pre 21 APIs the camera2 package is not available yet. You will have to work with camera
or upgrade to minSdk 21.