is Tablet by screen size - Android android.app

Android examples for android.app:Screen

Description

is Tablet by screen size

Demo Code

import android.content.Context;
import android.content.res.Configuration;

public class Main {

  public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
        & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
  }//  w  ww .  j a va  2  s  . c  om

}

Related Tutorials