passing values between activities
<p>Hello everyone I have the following code which is retreving some data from the server and when i click on any item it show me  the id which is retrieve from the server . Instead of showing in the toast i want to pass to another activity. here is the orginal code </p>

<pre><code>public class Test extends ListActivity  {
      Prefs myprefs = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.listplaceholder);
        this.myprefs = new Prefs(getApplicationContext());
        // install handler for processing gui update messages
        ArrayList&lt;HashMap&lt;String, String&gt;&gt; mylist = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
       JSONObject json = JSONfunctions.getJSONfromURL("http://midsweden.gofreeserve.com/proj/androidjson.php?identifier=" + 
        Test.this.myprefs.getPersonalno());

        try{

            JSONArray  earthquakes = json.getJSONArray("services");

            for(int i=0;i&lt;earthquakes.length();i++){                        
                HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();    
                JSONObject e = earthquakes.getJSONObject(i);

                map.put("id",  String.valueOf(i));
                map.put("pic", "Service name : " + e.getString("employeepic"));
                map.put("serviceinfo", "" +  e.getString("employeename")+ " : "+ e.getString("starttime")
                        +" To " +  e.getString("endtime"));
                mylist.add(map);            
            }       
        }catch(JSONException e)        {
             Log.e("log_tag", "Error parsing data "+e.toString());
        }

        ListAdapter adapter = new SimpleAdapter(this, mylist , R.layout.test, 
                        new String[] { "servicename", "serviceinfo" }, 
                        new int[] { R.id.item_title, R.id.item_subtitle });

        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) {              
                @SuppressWarnings("unchecked")
                HashMap&lt;String, String&gt; o = (HashMap&lt;String, String&gt;) lv.getItemAtPosition(position);                   
                Toast.makeText(Test.this, "ID '" + o.get("id") + "' was clicked.", Toast.LENGTH_SHORT).show(); 

            }
        });

    }
</code></pre>

<p>I am trying to adjust this code but every time "Force to Close"</p>

<pre><code>Intent intent = new Intent(Test.this, passing.class);
intent.putExtra("Employename", employeename);
startActivity(intent);
</code></pre>

<p>for the id its done in the following way . but now how can replace it with employename</p>

<pre><code>lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {              
            @SuppressWarnings("unchecked")
                HashMap&lt;String, String&gt; o = (HashMap&lt;String, String&gt;) lv.getItemAtPosition(position);                   
            Intent intent = new Intent(Test.this, passing.class);
            intent.putExtra("id", id);
            startActivity(intent); 

            }
        });

}
</code></pre>
