mirror of
https://github.com/FossifyOrg/Camera.git
synced 2026-06-13 18:49:51 -04:00
handle Camera.open() fail gracefully
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.simplemobiletools.camera;
|
||||
|
||||
import android.content.Context;
|
||||
import android.hardware.Camera;
|
||||
import android.widget.Toast;
|
||||
|
||||
public class Utils {
|
||||
public static Camera.CameraInfo getCameraInfo(int cameraId) {
|
||||
@@ -8,4 +10,8 @@ public class Utils {
|
||||
Camera.getCameraInfo(cameraId, info);
|
||||
return info;
|
||||
}
|
||||
|
||||
public static void showToast(Context context, int resId) {
|
||||
Toast.makeText(context, context.getResources().getString(resId), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user