title: RecyclerView showing actually deleted items
body: <h3>Problem</h3>
  
  <p>I am writing an android application that has to handle a variable amount of elements in a RecyclerView. When I add an element, some data gets saved into a configuration file along with an UUID.</p>
  
  <p>Either when the application starts or when the element gets created or removed by the user during runtime, the RecyclerView gets updated and shows all currently existing elements.</p>
  
  <p>Each of these elements has a button to remove it and its additional data from the configuration. When I press this button, the elements data successfully gets removed from the configuration and it turns invisible leading the RecyclerView only to show the remaining elements.</p>
  
  <p>However, when I try to insert a new element, it doesn't get shown but rather the element that has been removed previously during this session.</p>
  
  <h3>Tries</h3>
  
  <p>I have been looking for a solution for a while now.
  First of all, I startet reading the documentation over and over again, thinking that I missed something. I also viewed some online examples on how to remove an item from a RecyclerView properly but I can't get it working.</p>
  
  <h3>Code</h3>
  
  <pre><code>package com.rappee.protectiveparking.ui
  
  import android.support.v7.widget.RecyclerView
  import android.view.LayoutInflater
  import android.view.ViewGroup
  import com.rappee.protectiveparking.R
  import com.rappee.protectiveparking.core.Resources
  import java.util.*
  
  class ScrollerAdapter : RecyclerView.Adapter&lt; ConsoleViewHolder &gt;() , 
  DragItemTouchHelperAdapter {
  
  private var stockpile: Queue&lt; String &gt; = LinkedList&lt; String &gt;()
  private var holder: MutableList&lt; ConsoleViewHolder &gt; = ArrayList()
  
  fun push( identification: String ) {
  
      this.stockpile.add( identification )
      this.notifyItemInserted( this.itemCount - 1 )
  
  }
  
  fun remove( position: Int ) {
  
      this.holder.removeAt( position )
      this.notifyItemRemoved( position )
  
  }
  
  override fun onCreateViewHolder( parent: ViewGroup , type: Int ): ConsoleViewHolder {
  
      val view: ConsoleViewHolder = ConsoleViewHolder( LayoutInflater.from( parent.context ).inflate( R.layout.console , parent , false ) , this.stockpile.poll() )
      this.holder.add( view )
  
      return view
  
  }
  
  override fun onBindViewHolder( holder: ConsoleViewHolder , position: Int ) {
  
      return
  
  }
  
  override fun getItemCount(): Int {
  
      return this.holder.size + this.stockpile.size
  
  }
  
  override fun onItemMove( from: Int , to: Int ): Boolean {
  
      Collections.swap( this.holder , to , from )
  
      for ( i in 0 until this.holder.size ) {
  
          Resources.CONFIGURATION.push( "${this.holder.get( i ).identification}.${Resources.KEY_POSITION}" , "$i" )
  
      }
  
      this.notifyItemMoved( from , to )
      return true
  
  }
  
  }
  </code></pre>
  
  <h3>Behaviour</h3>
  
  <p>When I try to insert a new element, I actually put the UUID into 'stockpile' and call 'notifyItemInserted', so that 'onCreateViewHolder' gets activated. When this happens, I fetch the foremost UUID from 'stockpile' in form of a String to give it to the constructor of 'ConsoleViewHolder' as a parameter.
  Only when this method gets called, an actual View gets pushed into the RecyclerView ( not my decision! ).</p>
  
  <p>However, when I insert a new UUID and update the RecyclerView after an item got deleted, this method doesn't get called so that no new View can be shown.
  The only thing that changes is that the previously deleted View pops back up.</p>
  
  <p><strong>MY QUESTION: How can I fix this behaviour of my RecyclerView showing deleted items instead of newly pushed ones?</strong></p>