title: Android pass multiple data from list to another activity
body: <p>I have got:</p>
  
  <pre><code>mListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
      @Override
      public boolean onItemLongClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
          choosedOffer= mListTest1.get(position).toString();
          return false;
      }
  });
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void onBackPressed() {
      Intent intent = new Intent(ListviewActivity.this, MainActivity.class);
      intent.putExtra("text",choosedOffer);
      setResult(RESULT_OK, intent);
      finish();
  }
  </code></pre>
  
  <p>in one activity.</p>
  
  <p>The second activity contains:</p>
  
  <pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      super.onActivityResult(requestCode, resultCode, data);
  
          if (requestCode == 1) {
              if(resultCode == RESULT_OK){
                  String passedText=data.getStringExtra("text");
                  ar.add(passedText);
              }
          }
  
  }
  </code></pre>
  
  <p><strong>Now what I need:</strong></p>
  
  <p>After long click on <code>mListView</code> item, I want to store its position somehow and then, after button <code>"Back"</code> click, I want the position to be passed to <code>ar</code> array in second activity. It works but only for one item from list. If I click another position and then <code>"Back"</code> button, only the last clicked item position will be passed to another activity. Can I pass somehow all items/positions that were clicked before pressing <code>"Back"</code> button (not only the last one)?</p>