Android take layout through code -


i have xml layout file in layout folder in android. , want refer file through code add webview.

how can that?

you have give id layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical"     id="@+id/layout" >  </linearlayout> 

and can it:

linearlayout layout = (linearlayout) findviewbyid(r.id.layout); 

and can add webview layout.


Comments