I am trying to calculate the height of a linear layout after it is being inflated. However, every time the size returned is zero. Am I doing something wrong here?
The code is given below:
LayoutInflater layoutInflater = (LayoutInflater) getActivity()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mObjectActionsBar = (LinearLayout) layoutInflater
.inflate(R.layout.object_actions_bar, null);
mToolbarHeight = (float) mObjectActionsBar.getHeight();
mObjectActionsBar.setVisibility(View.GONE);
mWorkbenchFrame.addView(mObjectActionsBar);
Please help me in figuring out what the problem is here.