title: notifyDatasetChanged() is not working in Kotlin
body: <ul>
  <li><code>notifyDatasetChanged()</code> is not working, But instead of
  <code>notifydatasetChanged()</code>, if i pass the <code>eventList</code> with data to
  adapter directly after initializing <code>recyclerview</code> list loads fine.</li>
  <li>How to resolve this</li>
  </ul>
  
  <hr>
  
  <p><strong>ActEvents.kt</strong></p>
  
  <pre><code>class ActEvents : AppCompatActivity(){
  
      // Initializing an empty ArrayList to be filled with animals
      var eventList: MutableList&lt;TestModel&gt; = ArrayList()
  
      @set:Inject var retrofit: Retrofit? = null
  
      private lateinit var personDisposable: Disposable
  
      /******************* Life Cycle Methods *************************/
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          initOnCreate()
      }
  
      override fun onDestroy() {
          super.onDestroy()
          initOnDestroy()
      }
  
      override fun onSupportNavigateUp(): Boolean {
          onBackPressed()
          return true
      }
  
      override fun onCreateOptionsMenu(menu: Menu): Boolean {
          initOnCreateOptionsMenu(menu)
          return true
      }
  
      override fun onOptionsItemSelected(item: MenuItem): Boolean { return initOnOptionsItemSelected(item) }
      /******************* Life Cycle Methods *************************/
  
  
      /******************** Subscribers *******************************/
      private fun setRxJavaRecievers() {
  
          personDisposable = RxBus.listen(RxEvent.RxEventList::class.java).subscribe {
              eventList = it.personName.getmData()
              event_list.adapter!!.notifyDataSetChanged()
          }
      }
      /******************** Subscribers *******************************/
  
      /******************* Init Methods *******************************/
      /** Init On Create **/
      private fun initOnCreate() {
          //Set up the UI
          setContentView(R.layout.act_events)
          //Inject Dagger Component
          (application as CaringApp).netComponent.inject(this)
          //Set up toolbar
          setToolbar()
          //Set up the recycler view
          initRecyclerView()
          //Set Rx java receivers
          setRxJavaRecievers()
  
      }
  
  
  
      /** Init On Destroy **/
      private fun initOnDestroy() {
          //Un Register disposable
          if (!personDisposable.isDisposed) personDisposable.dispose()
      }
  
  
      /** Initialize recyclerView **/
      private fun initRecyclerView() {
          val mLayoutManager = LinearLayoutManager(applicationContext)
          event_list.layoutManager = mLayoutManager
          event_list.itemAnimator = DefaultItemAnimator()
          event_list.adapter = AdptEvents(eventList,this)
      }
  
  
      /******************* Init Methods *******************************/
  
  }
  </code></pre>
  
  <p><strong>AdptEvents.kt</strong></p>
  
  <pre><code>class AdptEvents (val items: MutableList&lt;TestModel&gt;, val context: Context) : RecyclerView.Adapter&lt;ViewHolder&gt;() {
  
      override fun onCreateViewHolder(parent: ViewGroup, p1: Int): ViewHolder {
          return ViewHolder(LayoutInflater.from(context).inflate(R.layout.row_event, parent, false))
      }
  
      override fun getItemCount(): Int {
          return items.size
      }
  
      override fun onBindViewHolder(holder: ViewHolder, position: Int) {
          holder.tvAnimalType.text = items[position].getName()
      }
  
  }
  
  class ViewHolder (view: View) : RecyclerView.ViewHolder(view) {
      // Holds the TextView that will add each animal to
      val tvAnimalType = view.txtTitle!!
  }
  </code></pre>