title: Update a Fragment do not working
body: <p>I am learning Android and when trying to develop an application I came across the following situation:</p>
  
  <p>I have an Activity that has two <code>Fragments</code>: <code>ReminderListFragment</code> and <code>FilterListFragment</code>. The first fragment has a list of Reminders and the second, a list of filters with the name and number of items registered in each filter. However, when I exclude some Reminder, the FilterListFragment values are not updated. The same thing happens when I delete one of the filters (in which case it deletes all records for the selected filter), it does not update the Reminders list.</p>
  
  <p><a href="https://i.stack.imgur.com/b2xqN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/b2xqN.png" alt="enter image description here"></a></p>
  
  <p><code>FilterListFragment</code> code:</p>
  
  <pre><code>    @Override
          public boolean onContextItemSelected(MenuItem item) {
              if (item.getGroupId() == R.id.context_menu_category) {
                  // Used to verify it it is the right context_menu //Gets the item
                  // position and gets the category in that position:
                  AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
                  Category category = ((CategoryFilter) lvFilters.getAdapter().getItem(info.position)).getCategory();
  
                  // Switch between the options in the context menu(Edit and Delete)
                  switch (item.getItemId()) {
                  case R.id.edit:
                      // Passes the current reminder to be edited via Intent and
                      // Invokes edit method
                      DialogFragment newFragment = EditCategoryDialogFragment.newInstance(category);
                      newFragment.show(getFragmentManager(), "" + R.string.dialog_editcategory_title);
                      updateListView();
                      return true;
                  case R.id.delete:
                      // Invokes delete method
                      try {
                          // Deletes from the bank;
                          Controller.instance(getActivity().getApplicationContext()).deleteReminderByCategory(category);
                          Controller.instance(getActivity().getApplicationContext()).deleteCategory(category);
                          updateListView();
                          return true;
                      } catch (DBException e) {
                          Log.e(TAG, e.getMessage());
                      }
                      updateListView();
                      return true;
                  default:
                      return super.onContextItemSelected(item);
                  }
  
              }
              return super.onContextItemSelected(item);
          }
  </code></pre>
  
  <p><code>ReminderListFragment</code> code:</p>
  
  <pre><code>@Override
      public boolean onContextItemSelected(MenuItem item) {
          if (item.getGroupId() == R.id.context_menu_reminder) {
              AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
              Reminder reminder = (Reminder) contextMenuAdapter.getItem(info.position);
              switch (item.getItemId()) {
              case R.id.edit:
                  Intent editIntent = editIntent(reminder);
                  editIntent.putExtra("id", reminder.getId());
                  editIntent.putExtra("text", reminder.getText());
                  editIntent.putExtra("details", reminder.getDetails());
                  startActivity(editIntent);
                  updateListView(null);
                  return true;
              case R.id.delete:
                  try {
                      Controller.instance(getActivity().getApplicationContext()).deleteReminder(reminder);
                  } catch (DBException e) {
                      Log.e(TAG, e.getMessage());
                  }
                  updateListView(null);
                  return true;
              default:
                  return super.onContextItemSelected(item);
              }
          }
          return super.onContextItemSelected(item);
      }
  </code></pre>