title: How to Convert Uri? data type to Uri
body: <p>I am initializing uri so that i can access it from anywhere</p>
  <p><code>private var myuri:Uri? = null</code></p>
  <p>now in Oncreate Method</p>
  <pre><code>Oncreate{
     button.setOnClickListner{
     uploadfile(filename, myuri)
     }
  }
  fun uploadfile(filename:String, fileuri:uri){
    .
    .
    .//some code
  }
  </code></pre>
  <p>there is an error says</p>
  <blockquote>
  <p>Type Mismatch required Uri found Uri?</p>
  </blockquote>
  <p>I cannot change anything from uploadfile function
  and i have to access myuri throughout this kotlin file.</p>