Reputation: 21
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
WindowManager wm = getWindowManager();
Display d = wm.getDefaultDisplay();
if(d.getWidth()>d.getHeight()){
}
Why getWidth()
not work? :(
Upvotes: 0
Views: 1464
Reputation: 20209
getHeight() and getWidth() was deprecated in API level 13. Use getSize(Point)
instead.
See http://developer.android.com/reference/android/view/Display.html#getHeight() and http://developer.android.com/reference/android/view/Display.html#getWidth()
try
WindowManager wm = getWindowManager();
Display d = wm.getDefaultDisplay();
Point point = new Point();
d.getSize(point);
if( d.x > d.y ) {
}
Upvotes: 2