Friday 30 August 2013

Android: How to detect device is Android phone or Android tablet?


public static boolean isTablet(Context context) {
    return (context.getResources().getConfiguration().screenLayout
            & Configuration.SCREENLAYOUT_SIZE_MASK)
            >= Configuration.SCREENLAYOUT_SIZE_LARGE;
}

No comments:

Post a Comment