title: Set Listview ID from an ID Attribute from a MySQL Connection
body: <p>i am at the beginning to learn java and androd programming and I hope you can help me.</p>
  
  <p>i want to set an id on a listview element. With this id I want to change my activity. The id should be the id which, also stand in a mysql database.</p>
  
  <p>My Connection to the mysql Database is working. I have all information in an array and each listelement show following information "Name ID: 1". The onclick listener works also.</p>
  
  <p>But how can i set the id to the listview? How how can i get the id information from the ArrayAdapter adapter?</p>
  
  <pre><code>protected void onPostExecute(String result) {
  
      if(result.equals("") == true || result.length() == 0 || result.equals("") == true || result == "|"){
          System.out.println("Hallo Welt!");
  
          result = "In der Datenbank gibt es keine Kategorie!";
  
      }
  
  
      // Senkrechter Strich entfernen
      String[] arr = result.split("\\|");
      ArrayAdapter adapter = new ArrayAdapter (this.context, android.R.layout.simple_list_item_1, arr);
      this.list.setAdapter(adapter);
  
      //TODO Onclick Listener
      this.list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
              Toast.makeText(context,  "my id to pass along the subview is " + position,Toast.LENGTH_LONG).show();
  
              Intent intent = new Intent(context, Activity.class);
              context.startActivity(intent);
          }
      });
  
  
  }
  </code></pre>
  
  <p>Thank you for your help...</p>