Issue
I have a pretty complex layout defined in xml
file , now I want to add this layout as a view using addView
or something else.
As layout is pretty much complex , its pretty cumbersome process to write the code for layout and then add it as a view. So is there anyway to load layout resource
and add it as a view.
I want to add the layout into WebView
Solution
Use
LayoutInflater factory = LayoutInflater.from(this);
View myView = factory.inflate(R.layout.my_layout_id, null);
then use addView(myView)
Answered By - Ramya K Sharma
Answer Checked By - Katrina (JavaFixing Volunteer)