title: android change listview font and color
body: <p>I've found loads of different ways of accomplishing this but I'm not sure what's the best for my scenario.</p>
  
  <p>This is my Java code for the listview:</p>
  
  <pre><code>ListView lv;
  lv = (ListView) findViewById(R.id.favList);
  </code></pre>
  
  <p>This is the xml code for the list:</p>
  
  <pre><code>&lt;ListView
          android:id="@+id/favList"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="40dp"
          android:layout_marginLeft="30dp"
          android:layout_marginRight="30dp"
          android:layout_marginTop="20dp"
          android:background="@android:color/transparent"
          android:cacheColorHint="@android:color/transparent"
          android:listSelector="@android:color/transparent" &gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>For a text view I would add:</p>
  
  <pre><code>final Typeface fontList = Typeface.createFromAsset(assets, "optima-extra-black.ttf");
  lv.setTypeface(fontList);
  </code></pre>
  
  <p>But this doesn't work for listviews.
  How do I change my font in this case?</p>
  
  <p>Oke I'm almost there...
  I need to access my assets but I can't from within my custom adapter.
  I tried using <code>final AssetManager assets = this.getAssets();</code> but that won't get me any further.. </p>
  
  <p>How to tackle this?</p>
  
  <pre><code>    class Myadapter extends BaseAdapter {
  
      LayoutInflater lif;
      ImageView sideArrow;
      TextView tv;
  
  
      public Myadapter(Context ctx) {
          lif = (LayoutInflater) ctx
                  .getSystemService(LAYOUT_INFLATER_SERVICE);
  
      }
  
      @Override
      public int getCount() {
  
          return favarets.size();
      }
  
      @Override
      public Object getItem(int position) {
          return position;
      }
  
      @Override
      public long getItemId(int position) {
          return position;
      }
  
      @Override
      public View getView(int position, View convertView, ViewGroup parent) {
  
          View vi = convertView;
          if (convertView == null)
              vi = lif.inflate(R.layout.inflate, null);
          sideArrow = (ImageView) vi.findViewById(R.id.imageViewsidemark);
  
          tv = (TextView) vi.findViewById(R.id.textFav);
          tv.setText(favarets.get(position));
          final AssetManager assets = this.getAssets();
          final Typeface tvFont = Typeface.createFromAsset(assets, "OPTIMA.TTF");
          tv.setTypeface(tvFont);
  
          tv.setTextColor(Color.BLACK);
  
          return vi;
  </code></pre>