title: Make a TextView inside a ListView use the default ListView row style
body: <p>My app generates 2 different lists, one uses the default <code>ListView</code> style as the <code>ListView</code> rows contain no <code>TextView</code> inside of them. The other list uses a custom <code>CursorAdapter</code> and has a <code>TextView</code> inside each row. All I want to do is make it so that the margins and text size are exactly the same for both lists.</p>
  
  <p>My first list is using a standard <code>ListView</code> with no <code>TextView</code> inside each row, here is what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/N5Xhd.png" alt="enter image description here"></p>
  
  <p>Here is the code to generate it:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.records);
  
      DatabaseHandler db = new DatabaseHandler(this);
      ArrayList&lt;String&gt; records = db.getRecords(this);
  
      this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, records));
  } 
  </code></pre>
  
  <p>Here is the xml file for it:</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="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>My second list is using a <code>ListView</code> with a <code>TextView</code> inside each row that is generated via a custom `CursorAdapter, here is what it looks like:</p>
  
  <p><img src="https://i.stack.imgur.com/rrasi.png" alt="enter image description here"></p>
  
  <p>Here is the code to generate it:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.achievements);
  
      DatabaseHandler db = new DatabaseHandler(this);
      Cursor cursor = db.getAchievements(this);
      AchievementAdapter cursorAdapter = new AchievementAdapter(this, cursor);
  
      this.setListAdapter(cursorAdapter);
  } 
  
  private class AchievementAdapter extends CursorAdapter {
      public AchievementAdapter(Context context, Cursor c) {
          super(context, c);
      }
  
      @Override
      public void bindView(View v, Context context, Cursor cursor) {
          TextView tv = (TextView) v.findViewById(R.id.achView1);
  
          if(cursor.getString(cursor.getColumnIndex("completed")).equals("yes")) {
              tv.setText(cursor.getString(cursor.getColumnIndex("name"))+" (completed)");
              tv.setTextColor(Color.GREEN);
          }
          else {
              tv.setText(cursor.getString(cursor.getColumnIndex("name")));
          }
      }
  
      @Override
      public View newView(Context context, Cursor cursor, ViewGroup parent) {
          LayoutInflater inflater = LayoutInflater.from(context);
          View v = inflater.inflate(R.layout.achievements_item, parent, false);
          return v;
      }
  }   
  </code></pre>
  
  <p>Here is the achievements xml file for it:</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="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content" /&gt;
  
      &lt;TextView
          android:id="@+id/android:empty"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:text=""/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is the achievements_item xml for it:</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" &gt;
  
      &lt;TextView
          android:id="@+id/achView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:text="" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Basically I just want these 2 lists to look exactly the same. Is there a way to do it so that the <code>TextView</code> inherits the default <code>ListView</code> row style? Or am I going to have to play with the margins and everything myself?</p>