As you can read android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
. @dcharms is right, you should do:
RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) innerLayout.getLayoutParams();
Because, the parent view which contains your innerLayout
is a RelativeLayout
not a LinearLayout
.
Let me know if you succeed.