@Override
  public void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (resultCode != ActionBarActivity.RESULT_OK) return;

    if (requestCode == REQUEST_NAME) {
      if (!data.getStringExtra(NamePromptDialogue.NAME)
          .isEmpty()) // checking if the name enetered by the user is empty or not
      adapter.checkOut(
            data.getIntExtra(NamePromptDialogue.POSITION, 1),
            data.getStringExtra(NamePromptDialogue.NAME));
    }

    if (requestCode == DELETE_REQUEST) {
      deleteAllBooks();
    }
  }
  // Updates the recycler view list.
  public void updateDisplay() {

    adapter.refresh(bookList);
    adapter.notifyDataSetChanged();
  }