How to initialize widgets in android using kotlin
<p>I have started to learn using kotlin language in android and getting problem while initialising my button variable ,because at the time of define my variable it ask to give some initial value when I initialize with null value and bind the variable in oncreate function its gives </p>

<blockquote>
  <p>kotlin.KotlinNullPointerException</p>
</blockquote>

<p>here is my code</p>

<pre><code>class AddsFragment : Fragment() {

    var Add: Button = null!!

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        val Rootview = inflater!!.inflate(R.layout.clubsfragment, null, false)
        Add = Rootview.findViewById(R.id.add) as Button
        return Rootview
    }
}
</code></pre>