title: View don't want to be updated
body: <p>I have a problem to update my view that changes the color in MainActivity. I click on cardview, entering the &quot;Edit note&quot; and change the color - all work, but when I return to see all notes the color doesn't change but when I close the app and launch it - color has changed. I can't figure out what's wrong with this behaviour</p>
  <p>MainActivity: onActivityResult</p>
  <pre><code>    if(requestCode == ADD_NOTE_REQUEST &amp;&amp; resultCode == RESULT_OK) {
          String title = data.getStringExtra(AddEditNoteeActivity.EXTRA_TITLE);
          String text = data.getStringExtra(AddEditNoteeActivity.EXTRA_TEXT);
          String selectedColor = data.getStringExtra(AddEditNoteeActivity.EXTRA_VIEW);
  
          Notee notee = new Notee(title, text, selectedColor);
          noteeViewModel.insert(notee);
  
          Toast.makeText(this, &quot;Note saved&quot;, Toast.LENGTH_SHORT).show();
  
      } else if(requestCode == EDIT_NOTE_REQUEST &amp;&amp; resultCode == RESULT_OK) {
          int id = data.getIntExtra(AddEditNoteeActivity.EXTRA_ID, -1);
  
          if(id == -1){
              Toast.makeText(this, &quot;Note can't be updated&quot;, Toast.LENGTH_SHORT).show();
              return;
          }
          String title = data.getStringExtra(AddEditNoteeActivity.EXTRA_TITLE);
          String text = data.getStringExtra(AddEditNoteeActivity.EXTRA_TEXT);
          String selectedColor = data.getStringExtra(AddEditNoteeActivity.EXTRA_VIEW);
  
          Notee notee = new Notee(title, text, selectedColor);
          
          notee.setId(id);
          noteeViewModel.update(notee);
          
          Toast.makeText(this, &quot;Note updated&quot;, Toast.LENGTH_SHORT).show();
  
      } else {
              Toast.makeText(this, &quot;Note not saved    &quot;, Toast.LENGTH_SHORT).show();
          }
      }
  </code></pre>
  <p>EditNoteActivity: saveNote</p>
  <pre><code>    String title = editTextTitle.getText().toString();
      String text = editText.getText().toString();
      String selectedColor = selectedNoteeColor;
  
  
      if(title.trim().isEmpty() || text.trim().isEmpty()){
          Toast.makeText(this, &quot;Please make a notes&quot;, Toast.LENGTH_SHORT).show();
          return;
      }
  
      Intent data = new Intent();
      data.putExtra(EXTRA_TITLE, title);
      data.putExtra(EXTRA_TEXT, text);
      data.putExtra(EXTRA_VIEW, selectedColor);
  
      int id = getIntent().getIntExtra(EXTRA_ID, -1);
      if (id != -1) {
          data.putExtra(EXTRA_ID, id);
      }
  
      setResult(RESULT_OK, data);
      finish();
  }
  </code></pre>
  <p>NoteeRepository</p>
  <pre><code>public class NoteeRepository {
  
  private NoteeDao noteeDao;
  private LiveData&lt;List&lt;Notee&gt;&gt; allNotes;
  
  
  public NoteeRepository(Application application){
      NoteeDatabase database = NoteeDatabase.getInstance(application);
      noteeDao = database.noteeDao();
      allNotes = noteeDao.getAllNotes();
  }
  
  public void insert(Notee notee){
  
      new InsertNoteeAsynTask(noteeDao).execute(notee);
  
  }
  
  public void delete(Notee notee){
      new DeleteNoteeAsynTask(noteeDao).execute(notee);
  }
  
  public void update(Notee notee){
      new UpdateNoteeAsynTask(noteeDao).execute(notee);
  }
  
  public void deleteAllNotees(){
      new DeleteAllNoteesAsynTask(noteeDao).execute();
  }
  
  public LiveData&lt;List&lt;Notee&gt;&gt; getAllNotes(){
      return allNotes;
  }
  
  private static class InsertNoteeAsynTask extends AsyncTask&lt;Notee, Void, Void&gt;{
  
      private NoteeDao noteeDao;
  
      private InsertNoteeAsynTask(NoteeDao noteeDao){
          this.noteeDao = noteeDao;
      }
  
      @Override
      protected Void doInBackground(Notee...notees){
  
          noteeDao.insert(notees[0]);
          return null;
      }
  }
  
  private static class DeleteNoteeAsynTask extends AsyncTask&lt;Notee, Void, Void&gt;{
  
      private NoteeDao noteeDao;
  
      private DeleteNoteeAsynTask(NoteeDao noteeDao){
          this.noteeDao = noteeDao;
      }
  
      @Override
      protected Void doInBackground(Notee...notees){
          noteeDao.delete(notees[0]);
          return null;
      }
  }
  
  private static class UpdateNoteeAsynTask extends AsyncTask&lt;Notee, Void, Void&gt;{
  
      private NoteeDao noteeDao;
  
      private UpdateNoteeAsynTask(NoteeDao noteeDao){
          this.noteeDao = noteeDao;
      }
  
      @Override
      protected Void doInBackground(Notee...notees){
          noteeDao.insert(notees[0]);
          return null;
      }
  }
  
  private static class DeleteAllNoteesAsynTask extends AsyncTask&lt;Notee, Void, Void&gt;{
  
      private NoteeDao noteeDao;
  
      private DeleteAllNoteesAsynTask(NoteeDao noteeDao){
          this.noteeDao = noteeDao;
      }
  
      @Override
      protected Void doInBackground(Notee...notees){
          noteeDao.deleteAllNote();
          return null;
      }
  }
  </code></pre>
  <p>}</p>
  <p>@Entity (tableName = &quot;note_table&quot;)
  public class Notee {</p>
  <pre><code>@PrimaryKey(autoGenerate = true)
  private int id;
  
  private String title;
  private String text;
  private String image;
  
  
  public Notee(String title, String text, String image) {
      this.title = title;
      this.text = text;
      this.image = image;
  
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  public int getId() {
      return id;
  }
  
  public String getTitle() {
      return title;
  }
  
  public String getText() {
      return text;
  }
  
  public String getImage() {
      return image;
  }
  </code></pre>
  <p>}</p>
  <p>@Override
  public void onBindViewHolder(@NonNull NoteeHolder holder, int position) {</p>
  <pre><code>    Notee currentNotee = getItem(position);
      holder.textViewText.setText(currentNotee.getText());
      holder.textViewTitle.setText(currentNotee.getTitle());
      holder.viewColor.setBackground(new ColorCircleDrawable(Color.parseColor(currentNotee.getImage())));
  }
  
  
  // Get the position of the notees
  
  public Notee getNoteAt(int position){
      return getItem(position);
  }
  
  
  
  
  class NoteeHolder extends RecyclerView.ViewHolder {
  
      private TextView textViewTitle;
      private TextView textViewText;
      private View viewColor;
  
      public NoteeHolder(@NonNull View itemView) {
          super(itemView);
  
          textViewTitle = itemView.findViewById(R.id.title);
          textViewText = itemView.findViewById(R.id.text);
          viewColor = itemView.findViewById(R.id.color);
  
          itemView.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View view) {
                  int position = getAdapterPosition();
                  if(listener != null &amp;&amp; position != RecyclerView.NO_POSITION) {
                      listener.OnItemClick(getItem(position));
                  }
              }
          });
  
      }
  </code></pre>
  <p>from NoteeViewModel</p>
  <pre><code>  public class NoteeViewModel extends AndroidViewModel {
  
      private NoteeRepository repository;
      private LiveData&lt;List&lt;Notee&gt;&gt; allNotes;
  
      public NoteeViewModel(@NonNull Application application) {
          super(application);
          repository = new NoteeRepository(application);
          allNotes = repository.getAllNotes();
      }
  
      public void insert(Notee notee){
          repository.insert(notee);
      }
  
      public void delete(Notee notee){
          repository.delete(notee);
      }
  
      public void update(Notee notee){
          repository.update(notee);
      }
  
      public void deleteAllNote(){
          repository.deleteAllNotees();
      }
  
      public LiveData&lt;List&lt;Notee&gt;&gt; getAllNotes() {
          return allNotes;
      }
  }
  </code></pre>
  <p>from MainActivity onCreate</p>
  <pre><code>noteeViewModel = ViewModelProviders.of(this).get(NoteeViewModel.class);
          noteeViewModel.getAllNotes().observe(this, new Observer&lt;List&lt;Notee&gt;&gt;() {
  
              @Override
              public void onChanged(@NonNull List&lt;Notee&gt; notees){
                  adapter.submitList(notees);
              }
          });
  </code></pre>