title: Android XML code : how to place an image left of Textview?
body: <p>In my Android Application i have 2 textviews and 1 image to e displayed on the listview. While i used my imageview it is going to the new line..</p>
  
  <p>I want one textview and imageview on the same line. Every time i place the imageview the whole alignment is changing ..</p>
  
  <p>my XML code is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="horizontal"
      android:padding="5dp" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginLeft="10dp"
          android:orientation="vertical" &gt;
  
          &lt;ImageView
              android:id="@+id/icon"
  
              android:layout_width="50dp"
              android:layout_height="50dp"
              android:gravity="left"
              android:layout_marginBottom="5dp"
              android:layout_marginLeft="5dp"
              android:layout_marginRight="5dp"
              android:layout_marginTop="5dp"
              android:src="@drawable/album1" /&gt;
  
  
          &lt;TextView
              android:layout_toRightOf="@id/icon"
              android:id="@+id/textViewSongName"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:singleLine="true"
              android:textColor="@android:color/white"
              android:textSize="22dp" /&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:id="@+id/textViewArtist"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:singleLine="true"
                  android:layout_weight="1"
                  android:textColor="@android:color/white"
                  android:textSize="15dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/textViewDuration"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:textColor="@android:color/white"
                  android:layout_marginLeft="10dp"
                  android:textSize="12dp" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>