My question is simple. I have a linearlayout. It has some child views. Now I want to add a view at the start of the child. Means in normal addView(view), the view s added at
Consider exploring the index argument of the addView
method in parent class ViewGroup, Specifically addView(View child, ViewGroup.LayoutParams params)
. This method adds a View to the parent layout with the params defined, the index acts as a preference or rather point of insertion of the view in the layout.
create a list of views, add your view to it and then add all views from layout to that list, remove all views from layout and add all views from your list
Use addView (View child, int index) with index = 0