Skip to content

Instantly share code, notes, and snippets.

@Richie97
Created April 13, 2012 19:55
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 Richie97/2379653 to your computer and use it in GitHub Desktop.
Save Richie97/2379653 to your computer and use it in GitHub Desktop.
More Tablet checking code
public boolean isTablet(Context context) {
boolean xlarge = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == 4);
boolean large = ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE);
return (xlarge || large);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment