Help.I found the height of ListView and I do not know px or dpi? I need dpi
final ListView actualListView = mPullRefreshListView.getRefreshableView();
actualListView.getViewTreeObserver().addOnGlobalLayoutListener(
new ViewTreeObserver.OnGlobalLayoutListener() {
public void onGlobalLayout() {
height = actualListView.getHeight();
}
});
getheight return height in pixels, Below is what docs says..
You need to convert px into dp , use below ways to convert it to dp.
Convert pixel to dp:
or if you want it in px use below.
Convert dp to pixel: