convert context to local variable
This commit is contained in:
parent
4ea83ba0da
commit
b45fb35b0f
|
@ -12,14 +12,12 @@ import com.squareup.otto.Bus;
|
||||||
class MarshmallowCamera {
|
class MarshmallowCamera {
|
||||||
private static final String TAG = MyCameraImpl.class.getSimpleName();
|
private static final String TAG = MyCameraImpl.class.getSimpleName();
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
private CameraManager manager;
|
private CameraManager manager;
|
||||||
private String cameraId;
|
private String cameraId;
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.M)
|
@TargetApi(Build.VERSION_CODES.M)
|
||||||
MarshmallowCamera(Context cxt) {
|
MarshmallowCamera(Context context) {
|
||||||
mContext = cxt;
|
manager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
|
||||||
manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
|
||||||
try {
|
try {
|
||||||
final String[] list = manager.getCameraIdList();
|
final String[] list = manager.getCameraIdList();
|
||||||
cameraId = list[0];
|
cameraId = list[0];
|
||||||
|
|
Loading…
Reference in New Issue