title: EditText and Button side by side
body: <p>I want to present in my layout an <code>EditText</code> and a <code>Button</code> side by side with a small space (margin) between them. I don't want to set a fixed size (I think that's a bad habit).</p>
  
  <p>How to do that?</p>
  
  <p><strong>My Try:</strong></p>
  
  <pre><code>&lt;RelativeLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content" &gt;
  
  &lt;EditText
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="left"
      android:layout_alignParentLeft="true" /&gt;
  
  &lt;Button
      android:id="@+id/btn_search"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentRight="true"
      android:layout_gravity="right" 
      android:text="Search" /&gt;
   &lt;/RelativeLayout&gt;
  </code></pre>