ViewStub vs. View.GONE ViewStub vs. View.GONE android android

ViewStub vs. View.GONE


The rendering performance comes into picture when you are inflating the views.

My guess is that its much cheaper to inflate a ViewStub than to inflate a View, either from XML or by changing visibility. ViewStub is especially used when you need to add/remove (indefinite) views (eg. add phone numbers to a given contact). Hope this is what you were looking for.