title: kotlin getting a subscriber to observe an observable using RxJava2
body: <pre><code>Android Studio 3.0 Beta2
  </code></pre>
  
  <p>I have created 2 methods one that creates the observable and another that creates the subscriber.</p>
  
  <p>However, I am having a issue try to get the subscriber to subscribe to the observable. In Java this would work, and I am trying to get it to work in Kotlin.</p>
  
  <p>In my onCreate(..) method I am trying to set this. Is this the correct way to do this?</p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          /* CANNOT SET SUBSCRIBER TO SUBCRIBE TO THE OBSERVABLE */
          createStringObservable().subscribe(createStringSubscriber())
      }
  
  
      fun createStringObservable(): Observable&lt;String&gt; {
          val myObservable: Observable&lt;String&gt; = Observable.create {
              subscriber -&gt;
              subscriber.onNext("Hello, World!")
              subscriber.onComplete()
          }
  
          return myObservable
      }
  
      fun createStringSubscriber(): Subscriber&lt;String&gt; {
          val mySubscriber = object: Subscriber&lt;String&gt; {
              override fun onNext(s: String) {
                  println(s)
              }
  
              override fun onComplete() {
                  println("onComplete")
              }
  
              override fun onError(e: Throwable) {
                  println("onError")
              }
  
              override fun onSubscribe(s: Subscription?) {
                  println("onSubscribe")
              }
          }
  
          return mySubscriber
      }
  }
  </code></pre>
  
  <p>Many thanks for any suggestions,</p>