title: How to set custom position for array elements on android
body: <p>On this activity :</p>
  
  <pre><code>public class ListfileActivity extends Activity {
  
  public int MainId;
  private ListView lv;
  private ArrayList&lt;String&gt; listview_array = new ArrayList&lt;String&gt;();
  
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
  
      // Read page from DB
      DatabaseHandler db = new DatabaseHandler(this);
      List&lt;Item&gt; items = db.getAllItemCid();   
  
      // Add to array
      for (Item cn : items) {
          listview_array.add("ID : " + cn.getId() + " Title : " + cn.getTitle());
      }
  
      // Make list view
      lv = (ListView) findViewById(R.id.listView1);
      lv.setAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, listview_array));
      lv.setTextFilterEnabled(true);
      lv.setOnItemClickListener(new OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3) {
              Intent item = new Intent(getApplicationContext(), ItemfileActivity.class);
              item.putExtra("id", arg2);
              startActivity(item);
          }
      });
  }
  }
  </code></pre>
  
  <p>I get all needed date by db.getAllItemCid() from database, And make listview whit data's, The problem is I need to add array element position on thos part : </p>
  
  <pre><code>for (Item cn : items) {
          listview_array.add("ID : " + cn.getId() + " Title : " + cn.getTitle());
  }
  </code></pre>
  
  <p>I want add each row id as position ( this is my row id for each row : getId() ) and select position on onItemClick part. as extra : item.putExtra("id", arg2); </p>
  
  <p>and send id ( position ) to next activity. </p>
  
  <p>This code work will, Just I need set position as id , now it set from 0 to ... , I want add each row id as position.  </p>