How to get Height of Android Action Bar for landscape mode while in portrait mode?

30 Views Asked by At

I need to get the height of the Android actionBar for landscape mode while the app is in portrait mode. I´m using followed code, and it works fine in portrait and in landscape mode, but I want the value before changing orientation.

    TypedValue typedValue = new TypedValue();
    if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, typedValue, true)) {
        actionBarHeight = TypedValue.complexToDimensionPixelSize(typedValue.data, resources.getDisplayMetrics());
    }
0

There are 0 best solutions below