Code example for HashMap

Methods: put

0
        result.putExtra("com.example.android.apis.Path", path);
        return result;
    } 
 
    protected void addItem(List<Map<String, Object>> data, String name, Intent intent) {
        Map<String, Object> temp = new HashMap<String, Object>();
        temp.put("title", name);
        temp.put("intent", intent);
        data.add(temp);
    } 
 
    @Override 
    @SuppressWarnings("unchecked") 
    protected void onListItemClick(ListView l, View v, int position, long id) {
        Map<String, Object> map = (Map<String, Object>)l.getItemAtPosition(position);
 
        Intent intent = (Intent) map.get("intent");
        startActivity(intent);
    } 
}