https://kotlinlang.org logo
Title
o

oday

11/07/2017, 2:41 PM
I have a crash happening from Android code itself, https://hastebin.com/analuxegis.nginx this happens when I press any of the list items that I’ve set up, while trying to setup an ItemTouchHelper https://github.com/Odaym/Snipit-Kotlin/tree/master/app/src/main/kotlin/com/om/snipit/ui the items load just fine, but pressing on any one of them produces that internal error, not related to any of my files
l

leosan

11/07/2017, 3:02 PM
just wondering what happens here if you call super and the viewholder is null
override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {
    if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {
      val itemViewHolder = viewHolder as ItemTouchHelperViewHolder?
      itemViewHolder!!.onItemSelected()
    }

    super.onSelectedChanged(viewHolder, actionState)
  }
nevermind is being checked
o

oday

11/07/2017, 7:51 PM
hey @leosan sorry to bother but in my case even an empty recycler view causes this exception when you press it, do you think it has to do with the way the reference to the recycler is being pulled? its through android extensions