title: Android: Creating contact thumbnail from name initials
body: <p>I've an Android <code>ListView</code> containing some emails. Some of them have contact thumbnails while some of them don't. For unknown contact thumbnails, I want to create a Bitmap, containing the initials of the corresponding email id. How can I achieve that? I've seen some Android apps using this technique to display contact thumbnail like this:</p>
  
  <p><img src="https://i.stack.imgur.com/bwlEi.png" alt="enter image description here"></p>
  
  <p>To start with, I'm using the following code:</p>
  
  <pre><code>ImageView iv=(ImageView)findViewById(R.id.imageView1);
      TextView view = (TextView)findViewById(R.id.textView1);
  
      Bitmap b=Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
      Canvas c = new Canvas(b);
      view.draw(c);
      iv.setImageBitmap(b);
  </code></pre>
  
  <p>Where the TextView holds a simple string. Unfortunately, it doesn't work. Can anyone please give me some pointers? Thanks a lot for your help!</p>