title: Create Layout Programmatically in android - issue
body: <p>I am creating FrameLayout dynamically using the following code</p>
  
  <p>mylayout.java</p>
  
  <pre><code>FrameLayout layout = new FrameLayout(this);
  FrameLayout.LayoutParams layoutparams=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT,Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);            
  layout.setLayoutParams(layoutparams);
  
  webview=new WebView(this);
  webview.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  
  splashview=new ImageView(this);
  splashview.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT));
  splashview.setScaleType(ScaleType.FIT_XY);
  splashview.setImageResource(R.drawable.splash);
  splashview.setVisibility(View.INVISIBLE);
  
  progressbar=new ProgressBar(this);
  FrameLayout.LayoutParams params=new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.MATCH_PARENT,Gravity.CENTER_HORIZONTAL|Gravity.CENTER_VERTICAL);
  progressbar.setLayoutParams(params);
  progressbar.setVisibility(View.INVISIBLE);          
  
  
  layout.addView(webview);
  layout.addView(progressbar);
  layout.addView(splashview);
  
  setContentView(layout);
  </code></pre>
  
  <p><strong>mylayout.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_gravity="center_vertical|center_horizontal"
      android:gravity="center_vertical|center_horizontal" &gt;
  
      &lt;WebView
          android:id="@+id/webview"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent" &gt;
      &lt;/WebView&gt;
  
  &lt;ProgressBar
      android:id="@+id/progressBar"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="center_vertical|center_horizontal"
      android:visibility="invisible" /&gt;
  
  
  
  
      &lt;ImageView
          android:id="@+id/splashscreen"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:contentDescription="@string/myimg"
          android:scaleType="fitXY"
          android:src="@drawable/splash"
          android:visibility="invisible" /&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>I need the <code>equalent code for the above xml file in java</code>. what mistake i did?</p>
  
  <p>Note: Using the above java code, each one is overlapping.</p>