is Tablet - Android android.content

Android examples for android.content:Context

Description

is Tablet

Demo Code

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

public class Main {

  public static boolean isTablet(Context context) {
    int screenLayout = context.getResources().getConfiguration().screenLayout;
    return (screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
  }/*ww  w  .jav a 2 s  .  c o  m*/

}

Related Tutorials