title: RecyclierView's notifyItemInserted does not work with arrayList
body: <p>I have 1 ArrayList and 1 RecyclerView. Data from DB are retrieved and stored in the ArrayList for displaying in the RecyclerView. All the things work fine with adding new item to the RecyclerView, but without the adding animation. I know I should use notifyItemInserted for the adding animation, but it didn't work. No inserting animation was appearing. Now I have to go back to the previous page and then get in the page again so that the added item was showing. So, how to add back the inserting animation?</p>
  
  <p>Any help will be very much appreciated. Thanks.</p>
  
  <p>Code to pass the data and set the adapter:</p>
  
  <pre><code> db = new DatabaseHelper(this);
      dbList = new ArrayList&lt;&gt;();
      dbList = db.getFilteredItems();
  
      RecyclerView mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
      mRecyclerView.setHasFixedSize(true);
      LinearLayoutManager llm = new LinearLayoutManager(this);
      llm.setOrientation(LinearLayoutManager.VERTICAL);
  
      //newest to oldest order (database stores from oldest to newest)
      llm.setReverseLayout(true);
      llm.setStackFromEnd(true);
  
      mRecyclerView.setLayoutManager(llm);
      mRecyclerView.setItemAnimator(new DefaultItemAnimator());
  
      adapter = new RecyclerAdapter(this, llm, dbList);
      mRecyclerView.setAdapter(adapter);
  </code></pre>
  
  <p>Code to retrieve data from DB:</p>
  
  <pre><code> //retrieve filtered data from DB
  public List&lt;AudioItem&gt; getFilteredItems(){
      List&lt;AudioItem&gt; audioList = new ArrayList&lt;&gt;();
      String titleName = EditActivity.titleName;
      String query = "select * from " + TABLE_NAME + " where " + COLUMN_NAME_RECORDING_NAME + " like '" + titleName + "%'";
  
      SQLiteDatabase db = this.getWritableDatabase();
      Cursor cursor = db.rawQuery(query,null);
  
      if (cursor.moveToFirst()){
          do {
              AudioItem audio = new AudioItem();
              audio.setId(Integer.parseInt(cursor.getString(0)));
              audio.setName(cursor.getString(1));
              audio.setFilePath(cursor.getString(2));
              audio.setLength(Integer.parseInt(cursor.getString(3)));
              audio.setTime(Long.parseLong(cursor.getString(4)));
              audioList.add(audio);
  
          }while (cursor.moveToNext());
          cursor.close();
      }
  
      return audioList;
  }
  </code></pre>
  
  <p>Code to insert data into the DB:</p>
  
  <pre><code>/* Insert data into database */
  public void addRecording(String recordingName, String filePath, long length) {
  
      SQLiteDatabase db = getWritableDatabase();
      ContentValues cv = new ContentValues();
      cv.put(COLUMN_NAME_RECORDING_NAME, recordingName);
      cv.put(COLUMN_NAME_RECORDING_FILE_PATH, filePath);
      cv.put(COLUMN_NAME_RECORDING_LENGTH, length);
      cv.put(COLUMN_NAME_TIME_ADDED, System.currentTimeMillis());
      db.insert(TABLE_NAME, null, cv);
      db.close();
  
      if (mOnDatabaseChangedListener != null) {
          mOnDatabaseChangedListener.onNewDatabaseEntryAdded();
      }
  }
  </code></pre>
  
  <p>Code to invoke the inserting animation:</p>
  
  <pre><code> @Override
  public void onNewDatabaseEntryAdded() {
      //item added to top of the list
      Log.e("Count: ", Integer.toString(getItemCount()));
     // notifyDataSetChanged();
      notifyItemInserted(getItemCount());
      //llm.scrollToPosition(getItemCount() - 1);
  }
  </code></pre>