title: how to programmatically create an imageView with id and src parameters?
body: <p>The following works, but I want to eliminate the xml so that I can change the image programmatically:
  Java:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.p6_touch);
      ImageView floatImage = (ImageView) findViewById(R.id.p6_imageView);
      floatImage.setOnTouchListener(this);    
  }
  </code></pre>
  
  <p>XML:</p>
  
  <pre class="lang-xml prettyprint-override"><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:background="@color/background_black" &gt;
      &lt;ImageView
          android:id="@+id/p6_imageView"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:scaleType="matrix"
          android:src="@drawable/p6_trail_map" &gt;
      &lt;/ImageView&gt;
      &lt;ImageView
            android:id="@+id/imageView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:onClick="showFlashlight"
            android:src="@drawable/legend_block24" /&gt;
  &lt;/FrameLayout&gt;
  </code></pre>