Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add View to a Fragment Dynamically in Android?

Is it possible to add a View to a Fragment dynamically? If it is, how can i do that?

like image 338
Paulo Barros Avatar asked Oct 10 '22 22:10

Paulo Barros


1 Answers

Is it possible to add a View to a Fragment dynamically?

Yes.

If it is, how can i do that?

The same way you would add a View anywhere else: call addView() on the View's parent container.

like image 173
CommonsWare Avatar answered Oct 13 '22 11:10

CommonsWare