title: Add webview into linearlayout android
body: <p>I want to add view into my main view....</p>
  
  <p>my main.xml file...</p>
  
  <pre><code>&lt;LinearLayout
          android:id="@+id/dynamicview"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:layout_weight="1.28"
          android:gravity="center_vertical"
          android:orientation="vertical" &gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I have another layout file call complete.xml</p>
  
  <pre><code>&lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;WebView
          android:id="@+id/webView1"
          android:layout_width="match_parent"
          android:layout_height="match_parent" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>I want to add this web view into linearlayout....it means I want to inflate webview into my mainactivity...</p>
  
  <p>I used the following method...</p>
  
  <pre><code>LinearLayout dynamic=(LinearLayout)findViewById(R.id.dynamicview);
  LayoutInflater inflater = (LayoutInflater)    getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
  View v = (FrameLayout) inflater.inflate(R.layout.complete, null);
          v.setBackgroundColor(Color.GREEN);
          v.getRootView();
          dynamic.addView(v);
          v.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p>but this doesn't work. if this is correct then color must be change...but nothing happened. pls help me.. I'm stuck with this...</p>
  
  <p>thanks</p>