title: unable to generate custom image using initials android kotlin
body: <p>i am trying to create an image view where if there is an image already in local storage then display that otherwise create a default image based on first letter of email.
  here is the code-&gt;</p>
  <pre><code>val drawerEmailIdValue = &quot;boy@gmail.com&quot;
          val photoText = drawerEmailIdValue.substring(0,1).toUpperCase()
  
          val drawerPhoto = nav_view.getHeaderView(0).findViewById&lt;ImageView&gt;(R.id.drawerProfileImage)
  
          val f = File(&quot;/data/data/com.example.demoapp11/app_imageDirectory&quot;, &quot;profileImage.jpg&quot;)
  
          if(f.exists()){
              val b = BitmapFactory.decodeStream(FileInputStream(f))
              drawerPhoto.setImageBitmap(b)
          }else{
              val b = Bitmap.createBitmap(100, 100, Bitmap.Config.ARGB_8888)
              val c = Canvas(b)
              c.drawText(photoText, x.toFloat(), y.toFloat(), Paint())
              drawerPhoto.setImageBitmap(b)
          }
  </code></pre>
  <p>but i dont see any image when i open drawer menu. can someone help me with this?</p>