title: Change background color and Font type to bold on item selected in Listview
body: <p>What i have tried : </p>
  
  <p>listview_selector_focussed.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="rectangle"&gt;
  
  &lt;gradient
  android:startColor="#008000"
  android:endColor="#00FF00"
  android:angle="90" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>listview_selector_pressed.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;shape
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="rectangle"&gt;
  
  &lt;gradient
  android:startColor="#800000"
  android:endColor="#FF0000"
  android:angle="90" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>listview_selector.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
  &lt;item
  android:state_focused="true"
  android:drawable="@drawable/listview_selector_focused" /&gt;
  
  &lt;item
  android:state_pressed="true"
  android:drawable="@drawable/listview_selector_pressed" /&gt;
  
  &lt;/selector&gt;
  </code></pre>
  
  <p>listview layout :</p>
  
  <pre><code>&lt;ListView
  
  android:listSelector="@color/listview_selector"
  /&gt;
  </code></pre>
  
  <ul>
  <li><p>I have tried this much.. but un-fortunately this thing wont work</p></li>
  <li><p>I want to change the listview row color when i click and when i click on another row previous row must be deselected and regain original state</p></li>
  </ul>
  
  <p>Adapter class :</p>
  
  <pre><code>public class ListViewAdapter extends BaseAdapter {
  
      Context ctx;
      ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist;
      LayoutInflater inflater;
  
      TextView tvA, tvB;
      String a, b;
  
      String out;
  
      ListViewAdapter(Context ctx, ArrayList&lt;HashMap&lt;String, String&gt;&gt; arraylist) {
  
          this.ctx = ctx;
          this.arraylist = arraylist;
      }
  
  
      @Override
      public int getCount() {
          return arraylist.size();
      }
  
      @Override
      public Object getItem(int position) {
          return arraylist.get(position);
      }
  
      @Override
      public long getItemId(int position) {
          return 0;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
          inflater = (LayoutInflater) ctx
                  .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          View itemView = inflater.inflate(R.layout.listitem, parent, false);
  
          tvA = (TextView) itemView.findViewById(R.id.tvA);
          tvB = (TextView) itemView.findViewById(R.id.tvB);
  
  
  
  
          tvA.setText(arraylist.get(position).get("a"));
  
  
  
          a = arraylist.get(position).get("a");
          b = arraylist.get(position).get("b");
  
  
  
          return itemView;
      }
  </code></pre>
  
  <p>listview adapter layout :</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="#ffffff"
      android:orientation="horizontal"&gt;
  
  
      &lt;TextView
          android:padding="5dp"
          android:id="@+id/tvA"
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_weight="1"
          android:minLines="2"
          android:gravity="center_vertical"
          android:text="Large Text"
          android:textStyle="bold"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:textColor="#0052a5"
          android:textSize="@dimen/font_large" /&gt;
  
  
      &lt;TextView
          android:padding="5dp"
          android:id="@+id/tvB"
          android:layout_width="wrap_content"
          android:layout_height="match_parent"
          android:gravity="bottom"
          android:text="Small Text"
          android:textAppearance="?android:attr/textAppearanceSmall"
          android:textColor="#0052a5" /&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>