title: Android - Declare and use views in Kotlin
body: <p>I am trying to use kotlin for android and trying to declare Linearlayout like this: </p>
  
  <pre><code>internal var linlay_SuccessfulPayment : LinearLayout = null!!
  internal var linlay_failPayment : LinearLayout
  
  linlay_SuccessfulPayment = findViewById(R.id.linlay_SuccessfulPayment) as LinearLayout
  linlay_failPayment = findViewById(R.id.linlay_failPayment) as LinearLayout
  </code></pre>
  
  <p>But in log I am getting this : </p>
  
  <pre><code>Caused by: kotlin.KotlinNullPointerException
                                                                           at com.example.activities.PaymentResult.&lt;init&gt;(Result.kt:14)
                                                                           at java.lang.Class.newInstance(Native Method)
                                                                           at android.app.Instrumentation.newActivity(Instrumentation.java:1096)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3415) 
                                                                           at android.app.ActivityThread.access$1100(ActivityThread.java:229) 
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                           at android.os.Looper.loop(Looper.java:148) 
                                                                           at android.app.ActivityThread.main(ActivityThread.java:7329) 
                                                                           at java.lang.reflect.Method.invoke(Native Method) 
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
  </code></pre>
  
  <p>Please help me out.</p>