title: Passing info from one intent to the other
body: <p>I have an app which reads some data from JSON, and I have 2 classes which do this.</p>
  <p>Right now both classes display the full list of registered members.
  But what I'm trying to achieve is that when a member is clicked I only get to see that member and not the other ones as well.</p>
  <p>Here is the code from both classes:</p>
  <p>From the listview:</p>
  <pre><code>public class Listviewer extends ListActivity {
      
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
  
  
          setContentView(R.layout.listplaceholder);
  
         
          ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
        
         
          JSONObject json = JSONfunctions.getJSONfromURL(&quot;http://de-saksen.nl/deelnemers.txt&quot;);
                  
          try{
              
              JSONArray  deelnemers = json.getJSONArray(&quot;deelnemers&quot;);
              
              for(int i=0;i&lt;deelnemers.length();i++){                     
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    
                  JSONObject e = deelnemers.getJSONObject(i);
                  
                  map.put(&quot;id&quot;,  String.valueOf(i));
                  map.put(&quot;name&quot;, &quot;Character Naam: &quot; +  e.getString(&quot;naamingw2&quot;));
                  map.put(&quot;sex&quot;, &quot;Geslacht: &quot; +  e.getString(&quot;geslacht&quot;));
                  map.put(&quot;rank&quot;, &quot;Rang: &quot; +  e.getString(&quot;rang&quot;));
  
                  mylist.add(map);            
              }   
                 
              
              
          }catch(JSONException e)        {
               Log.e(&quot;log_tag&quot;, &quot;Error parsing data &quot;+e.toString());
          }
          
          ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.main, 
                          new String[] { &quot;name&quot;, &quot;sex&quot;, &quot;rank&quot;}, 
                          new int[] { R.id.item_title, R.id.item_subtitle, R.id.item_subtitle2 });
          
          setListAdapter(adapter);
          
          final ListView lv = getListView();
          lv.setTextFilterEnabled(true);  
          lv.setOnItemClickListener(new OnItemClickListener() {
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              
                  Intent intent = new Intent(Listviewer.this, Profileviewer.class);   
                  startActivity(intent); 
              }
          });
  
      
      
      }
  }
  </code></pre>
  <p>And from the profile view:</p>
  <pre><code>public class Profileviewer extends ListActivity {
      
       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
  
          setContentView(R.layout.listplaceholder);
         
          ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
         
          JSONObject json = JSONfunctions.getJSONfromURL(&quot;http://de-saksen.nl/deelnemers.txt&quot;);
                  
          try{
              
              JSONArray  deelnemers = json.getJSONArray(&quot;deelnemers&quot;);
              
              for(int i=0;i&lt;deelnemers.length();i++){                     
                  HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    
                  JSONObject e = deelnemers.getJSONObject(i);
                  
                  map.put(&quot;id&quot;,  String.valueOf(i));
                  map.put(&quot;name&quot;, &quot;Naam: &quot; +  e.getString(&quot;naamingw2&quot;));
                  map.put(&quot;sex&quot;, &quot;Geslacht: &quot; +  e.getString(&quot;geslacht&quot;));
                  map.put(&quot;rank&quot;, &quot;Rang: &quot; +  e.getString(&quot;rang&quot;));
                  map.put(&quot;race&quot;, &quot;Ras: &quot; +  e.getString(&quot;ras&quot;));
                  map.put(&quot;profession&quot;, &quot;Beroep: &quot; +  e.getString(&quot;beroep&quot;));
                  map.put(&quot;skills&quot;, &quot;Hobby's: &quot; +  e.getString(&quot;hobbys&quot;));
                  map.put(&quot;lvl&quot;, &quot;Level: &quot; +  e.getString(&quot;level&quot;));
                  mylist.add(map);            
              }   
                 
              
              
          }catch(JSONException e)        {
               Log.e(&quot;log_tag&quot;, &quot;Error parsing data &quot;+e.toString());
          }
          
          ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.profile, 
                          new String[] { &quot;name&quot;, &quot;sex&quot;, &quot;rank&quot;, &quot;race&quot;, &quot;profession&quot;, &quot;skills&quot;, &quot;lvl&quot; }, 
                          new int[] { R.id.item_title, R.id.item_subtitle, R.id.item_subtitle2, R.id.item_subtitle3, R.id.item_subtitle4, R.id.item_subtitle5, R.id.item_subtitle6 });
          
          setListAdapter(adapter);
          
          final ListView lv = getListView();
          lv.setTextFilterEnabled(true);  
          lv.setOnItemClickListener(new OnItemClickListener() {
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              
                  Intent intent = new Intent(Profileviewer.this, Listviewer.class);   
                  startActivity(intent); 
              }
          });
  
      
      
      }
  }
  </code></pre>
  <p>I recon I have to pass a variable to the other class containing what member has been clicked, but how do I achieve this?</p>