This is working fine on emulator but not on the devices because I have hard coded the height to 365. Can anyone help me in this regard?
You can change the layout height dynamically through different ways-----
First,
getLayoutParams().height= x; requestLayout(); or invalidate();
Secondly,
first_tab.setHeight(int pixels);
Try using anyone of the way.......