In my app I'm adding many views inside the Layout having below properties how shall i get the correct height of the layout at run time
        LinearLayout ll = new LinearLayout(this);
        ll.setLayoutParams(new LayoutParams(840,LayoutParams.WRAP_CONTENT));
        ll.setOrientation(LinearLayout.VERTICAL);
        ll.addView(view1); 
        ll.addView(view2);
        ll.getHeight();
how to get Height of layout at that point consider adding of view1 and view2 , irrespective of my property(LayoutParams.WRAP_CONTENT), beacause it always return 0 to me?