Fixing crash

csv
Laurent 6 years ago
parent 26a62c0c83
commit cdf38e1716
  1. 3
      app/src/main/java/net/pokeranalytics/android/ui/view/ContextMenuRecyclerView.kt

@ -5,7 +5,6 @@ import android.util.AttributeSet
import android.view.ContextMenu
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import timber.log.Timber
class ContextMenuRecyclerView : RecyclerView {
@ -22,10 +21,8 @@ class ContextMenuRecyclerView : RecyclerView {
override fun showContextMenuForChild(originalView: View): Boolean {
val longPressPosition = getChildAdapterPosition(originalView)
Timber.d("longPressPosition = $longPressPosition")
if (longPressPosition >= 0) {
val longPressId = adapter!!.getItemId(longPressPosition)
Timber.d("longPressId = $longPressId")
mContextMenuInfo = RecyclerViewContextMenuInfo(longPressPosition, longPressId)
return super.showContextMenuForChild(originalView)
}

Loading…
Cancel
Save