title: Inconsistency detected. Invalid item position 0(offset:-1)... RecyclerView crashes, on deleting first item
body: <p>I am trying to delete the first item in my <code>RecyclerView</code>. The changes to list is monitored using livedata and diffutil. The crash happens <strong>only when</strong> the first item in <code>RecyclerView</code> is deleted (0th index). This might seem similar to other related questions. The issue doesn't occur while scrolling fast, etc. Ot only occurs while removing item at 0th position. The item itself is deleted from the DB. But app crashes. I tried retracing the error from the <code>RecyclerView</code> class: <code>.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5923)</code></p>
  
  <p>From RecyclerView.java: </p>
  
  <pre><code>if (offsetPosition &lt; 0 || offsetPosition &gt;= mAdapter.getItemCount()) {
              throw new IndexOutOfBoundsException("Inconsistency detected. Invalid item "
                      + "position " + position + "(offset:" + offsetPosition + ")."
                      + "state:" + mState.getItemCount());
          }
  </code></pre>
  
  <p>The offset position is less than 0 (-1)</p>
  
  <p>Complete error stack:</p>
  
  <pre><code>03-23 08:55:38.739 25087-25087/com.application.essentials E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.application.essentials, PID: 25087
  java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 0(offset:-1).state:3 android.support.v7.widget.RecyclerView{41df14f0 VFED.V.. ......ID 0,0-480,606 #7f080084 app:id/recycler_view}, adapter:com.application.essentials.model.AlarmsAdapter@41dd7d80, layout:android.support.v7.widget.LinearLayoutManager@41e10b80, context:com.application.essentials.MainActivity@41d37840
      at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5923)
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
      at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
      at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
      at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
      at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
      at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:622)
      at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3875)
      at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3639)
      at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:4194)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)
      at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1183)
      at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:870)
      at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:889)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)
      at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1775)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)
      at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:142)
      at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:41)
      at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1556)
      at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:888)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)
      at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
      at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)
      at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
      at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
      at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
      at android.view.View.layout(View.java:15819)
      at android.view.ViewGroup.layout(ViewGroup.java:4884)...
  </code></pre>