title: Realm Database Design Note app Stock on Edit note
body: <p>so i have this app where in MainActivity ther is the RecyclerView for showing the Notes
  and i want when click on the note to open the note and can edit it basically AddNoteActivity with Data that saved by Realm ,</p>
  <p>do i need make new activity and call it edit activity
  and how i send the data and update it</p>
  <p>MainActivity</p>
  <pre><code>        MaterialButton addNoteBtn = findViewById(R.id.addnewnotebtn);
          addNoteBtn.setOnClickListener (new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  startActivity(new Intent(MainActivity.this,AddNoteActivity.class));
              }
          });
          // START REALM
          Realm.init(getApplicationContext());
          Realm realm = Realm.getDefaultInstance();
          RealmResults&lt;Note&gt; notesList = realm.where(Note.class).sort(&quot;createdTime&quot;, Sort.DESCENDING). findAll();
  
          RecyclerView recyclerView = findViewById(R.id.recyclerview);
          recyclerView.setLayoutManager(new LinearLayoutManager(this));
          MyAdapter myAdapter = new MyAdapter(getApplicationContext(),notesList);
          recyclerView.setAdapter(myAdapter);
  
          notesList.addChangeListener(new RealmChangeListener&lt;RealmResults&lt;Note&gt;&gt;() {
              @Override
              public void onChange(RealmResults&lt;Note&gt; notes) {
                  myAdapter.notifyDataSetChanged();
              }
          });
  
  
  </code></pre>
  <p>AddNoteActivity</p>
  <pre><code>
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_add_note);
  
          // Define ActionBar object
          ActionBar actionBar;
          actionBar = getSupportActionBar();
          getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
          getSupportActionBar().setCustomView(R.layout.action_bar_layout);
  
          // Define ColorDrawable object and parse color
          // using parseColor method
          // with color hash code as its parameter
          ColorDrawable colorDrawable
                  = new ColorDrawable(Color.parseColor(&quot;#803c94&quot;));
  
          // Set BackgroundDrawable
          actionBar.setBackgroundDrawable(colorDrawable);
  
          EditText titleInput = findViewById(R.id.titleinput);
          EditText descriptionInput = findViewById(R.id.descriptioninput);
          MaterialButton saveBtn = findViewById(R.id.savebtn);
  
          Realm.init(getApplicationContext());
          Realm realm = Realm.getDefaultInstance();
  
          saveBtn.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  String title = titleInput.getText().toString();
                  String description = descriptionInput.getText().toString();
                  long createdTime = System.currentTimeMillis();
  
                  realm.beginTransaction();
                  Note note = realm.createObject(Note.class);
                  note.setTitle(title);
                  note.setDescription(description);
                  note.setCreatedTime(createdTime);
                  realm.commitTransaction();
                  Toast.makeText(getApplicationContext(),&quot;Note SAVED&quot;,Toast.LENGTH_SHORT).show();
                  finish();
  
              }
          });
      }```
  </code></pre>