I am trying to change linear layout or any other widget width or height dynamically but throwing exception.
My layout is:
The problem here is that when you set the layout params the type needs to be that of the parent, in this case that is a FrameLayout. You need to do this:
ll.setLayoutParams(new FrameLayout.LayoutParams(30,60));