title: I was wondering if it is possible to create one arraylist for two different listviews across different activities in android studio?
body: <p>This is the activity where i add my person objects into the arraylist and i was planning on bringing over the same arraylist to another activity(editList.java) to display the same listview but i am not sure how.  I've researched on this topic but there is only help on how to put multiple arraylist into one listview. Please note i am quite new to android programming</p>
  
  <p>people.java</p>
  
  <pre><code>public class people extends AppCompatActivity {
  Button btnAdd;
  Button btnDelete;
  ListView lvPeople;
  
  
  ArrayList&lt;person&gt; alPeople = new ArrayList&lt;person&gt;();
  ArrayAdapter&lt;person&gt; aaPeople;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_people);
  
      btnAdd = (Button) findViewById(R.id.btnAdd);
      btnDelete = (Button) findViewById(R.id.btnDelete);
      lvPeople = (ListView) findViewById(R.id.lvPeople);
  
  
      aaPeople = new ArrayAdapter&lt;person&gt;(this, android.R.layout.simple_list_item_1, alPeople);
      lvPeople.setAdapter(aaPeople);
  
      btnAdd.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View viewDialog = inflater.inflate(R.layout.add_dialog, null);
              final EditText etName = (EditText) viewDialog.findViewById(R.id.etName);
              final EditText etAge = (EditText) viewDialog.findViewById(R.id.etAge);
              final DatePicker dpBirthdate = (DatePicker) viewDialog.findViewById(R.id.dpBirthdate);
              AlertDialog.Builder myBuilder = new AlertDialog.Builder(people.this);
  
              myBuilder.setView(viewDialog);
              myBuilder.setTitle("Add person to list");
  
              myBuilder.setPositiveButton("Add", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      String name = etName.getText().toString();
                      String age = etAge.getText().toString();
                      int dpBirthdateDay = dpBirthdate.getDayOfMonth();
                      int dpBirthdateMonth = dpBirthdate.getMonth() + 1;
                      int dpBirthdateYear = dpBirthdate.getYear();
  
                      String birthday = Integer.toString(dpBirthdateDay) + "/" + Integer.toString(dpBirthdateMonth) + "/" + Integer.toString(dpBirthdateYear);
                      person person = new person();
                      person.setName(name);
                      person.setAge(age);
                      person.setExtbirthday(birthday);
                      person.setBirthday(Integer.toString(dpBirthdateDay));
                      person.setBirthmonth(Integer.toString(dpBirthdateMonth));
                      person.setBirthyear(Integer.toString(dpBirthdateYear));
  
                      alPeople.add(person);
                      aaPeople.notifyDataSetChanged();
                      Toast.makeText(people.this, "Person Added", Toast.LENGTH_LONG).show();
  
  
                  }
              });
              AlertDialog myDialog = myBuilder.create();
              myDialog.show();
          }
      });
  
  
      //this is code for list view item click
      int personPos = 0;
      lvPeople.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
              LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View viewDialog = inflater.inflate(R.layout.person_dialog, null);
              final TextView tvName = (TextView) viewDialog.findViewById(R.id.tvName);
              final TextView tvAge = (TextView) viewDialog.findViewById(R.id.tvAge);
              final TextView tvBirthdate = (TextView) viewDialog.findViewById(R.id.tvBirthdate);
              AlertDialog.Builder myBuilder = new AlertDialog.Builder(people.this);
  
              myBuilder.setView(viewDialog);
              myBuilder.setTitle("Person Info");
  
              int personPos = position;
              tvName.setText(alPeople.get(personPos).getName());
              tvAge.setText(alPeople.get(personPos).getAge());
              tvBirthdate.setText(alPeople.get(personPos).getExtbirthday());
  
              myBuilder.setPositiveButton("ok", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
  
                  }
              });
              AlertDialog myDialog = myBuilder.create();
              myDialog.show();
          }
      });
      btnDelete.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              LayoutInflater inflater = (LayoutInflater) getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
              View viewDialog = inflater.inflate(R.layout.delete_dialog, null);
              final EditText etIndex = (EditText) viewDialog.findViewById(R.id.etIndex);
  
              AlertDialog.Builder myBuilder = new AlertDialog.Builder(people.this);
  
              myBuilder.setView(viewDialog);
              myBuilder.setTitle("Delete Person");
  
  
              myBuilder.setPositiveButton("Delete", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
                      int index = Integer.parseInt(etIndex.getText().toString());
                      if (alPeople.size() == 0) {
                          Toast.makeText(people.this, "There is nothing to delete", Toast.LENGTH_LONG).show();
                      } else {
                          alPeople.remove(index - 1);
  
                          aaPeople.notifyDataSetChanged();
                      }
  
                  }
              });
              myBuilder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                  @Override
                  public void onClick(DialogInterface dialog, int which) {
  
                  }
              });
              AlertDialog myDialog = myBuilder.create();
              myDialog.show();
          }
      });
  }}
  </code></pre>