Skip to content

Instantly share code, notes, and snippets.

@yaronv
Created May 27, 2015 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yaronv/98cdab11598541f89c03 to your computer and use it in GitHub Desktop.
Save yaronv/98cdab11598541f89c03 to your computer and use it in GitHub Desktop.
public boolean isCameraSupported(Context context) {
PackageManager packageManager = context.getPackageManager();
if(packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA) == false){
Toast.makeText(context, "This device does not have a camera.", Toast.LENGTH_SHORT).show();
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment