/**
* Determine whether it is a tablet
*
* @return
*/
private boolean isPad() {
WindowManager wm = (WindowManager) getSystemService(Context.WINDOW_SERVICE);
Display display = ();
// Screen width
float screenWidth = ();
// Screen height
float screenHeight = ();
DisplayMetrics dm = new DisplayMetrics();
(dm);
double x = ( / , 2);
double y = ( / , 2);
// Screen size
double screenInches = (x + y);
// If the size is greater than 6, it is a Pad
if (screenInches >= 6.0) {
return true;
}
return false;
}