title: Pass ListView values to multiple EditText in another Activity
body: <p>I have an Activity that has two clickable EditTexts and I am trying to pass value from two different ListView Activities. Every time I try to populate value to the second EditText, the value of the other EditText is cleared.</p>
  
  <p>I need help in figuring out where I am wrong and a possible resolution.</p>
  
  <p>This is the code for the Activity with both EditTexts</p>
  
  <pre><code> @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.book_seat);
  
  
          //Departure
          depart = (EditText)findViewById(R.id.departure_terminal);
          // This is a listener for the one way departure terminal
          depart.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(BookSeat.this,TerminalList.class);
                  startActivity(intent);
              }
          });
          // Receiving value into activity using intent.
          String TempHolder = getIntent().getStringExtra("ListViewClickedValue");
          // Setting up received value into EditText.
          depart.setText(TempHolder);
  
  
          //Arrival
          arrive = (EditText)findViewById(R.id.arrival_terminal);
          // This is a listener for the one way arrival terminal
          arrive.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  Intent intent = new Intent(BookSeat.this,ArrivalTerminalList.class);
                  startActivity(intent);
              }
          });
          // Receiving value into activity using intent.
          String TempHolder_1 = getIntent().getStringExtra("ArrivalListViewClickedValue");
          // Setting up received value into EditText.
          arrive.setText(TempHolder_1);
  </code></pre>
  
  <p>This is the code for the first ListView </p>
  
  <pre><code>public class TerminalList extends AppCompatActivity {
  
      ListView listView;
  
      // Define string array.
      String[] listValue = new String[] {"Anambra =&gt; Awka","Delta(South-East) =&gt; Asaba(Onitsha)","Enugu =&gt; Enugu",
              "FCT Abuja =&gt; Kubwa","Imo =&gt; Owerri","Kaduna =&gt; Kaduna","Lagos =&gt; Cele/Okota","Lagos =&gt; Festac(MazaMaza)","Plateau =&gt; Jos"};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.terminal_list);
  
          listView = (ListView)findViewById(R.id.listView1);
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, android.R.id.text1, listValue);
  
          listView.setAdapter(adapter);
  
          // ListView on item selected listener.
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
          {
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                      int position, long id) {
                  // TODO Auto-generated method stub
  
                  // Getting listview click value into String variable.
                  String ListViewClickedValue = listValue[position].toString();
  
                  Intent intent = new Intent(TerminalList.this, BookSeat.class);
  
                  // Sending value to another activity using intent.
                  intent.putExtra("ListViewClickedValue", ListViewClickedValue);
  
                  startActivity(intent);
                  finish();
  
              }
          });
      }
  }
  </code></pre>
  
  <p>This is the code for the second ListView</p>
  
  <pre><code>public class ArrivalTerminalList extends AppCompatActivity {
  
      ListView listView;
  
      // Define string array.
      String[] listValue = new String[] {"Anambra =&gt; Awka","Delta(South-East) =&gt; Asaba(Onitsha)","Enugu =&gt; Enugu",
              "FCT Abuja =&gt; Kubwa","Imo =&gt; Owerri","Kaduna =&gt; Kaduna","Lagos =&gt; Cele/Okota","Lagos =&gt; Festac(MazaMaza)","Plateau =&gt; J-Town"};
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.arrival_terminal_list);
  
          listView = (ListView)findViewById(R.id.listView2);
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,android.R.layout.simple_list_item_1, android.R.id.text1, listValue);
  
          listView.setAdapter(adapter);
  
          // ListView on item selected listener.
          listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
          {
  
              @Override
              public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                                      int position, long id) {
                  // TODO Auto-generated method stub
  
                  // Getting listview click value into String variable.
                  String ArrivalListViewClickedValue = listValue[position].toString();
  
                  Intent intent = new Intent(ArrivalTerminalList.this, BookSeat.class);
  
                  // Sending value to another activity using intent.
                  intent.putExtra("ArrivalListViewClickedValue", ArrivalListViewClickedValue);
  
                  startActivity(intent);
  
              }
          });
      }
  }
  </code></pre>