I am working on an Android project in which I have a list of items shown to the user along-with its images. The problem right now is because of the modifications I had to do to set the list, I don't know how I can change the code to include the id of the object which is being clicked by the user. I would not like the position, but the id which is received from the server. Any help would be nice. Thanks a lot. :-)

Please note, relevant code is more in the first class below, I have just put the LazyAdapter if there are modifications requried in it. Thanks a lot. 

GroupCanvasActivity.java :

```
public class GroupCanvasActivity extends Activity {

    private static volatile Long groupAccountid = (long) 0;

    List<RestCanvas> restCanvasList = new ArrayList<>();

    private CanvasServiceImpl canvasService = new CanvasServiceImpl();

    LazyAdapter lazyAdapter;
    ListView listView;

    static final String mcanvasid = "canvasid";
    static final String mcanvastitle = "canvastitle";
    static final String mcanvasname = "mcanvasname";
    static final String mcanvasimage = "mcanvasimage";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.canvaslayout);

        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            groupAccountid = extras.getLong("groupid");
        }

        restCanvasList = this.canvasService.getGroupCanvasForGroupAccount(groupAccountid);

        ArrayList<HashMap<String, String>> canvaslist = new ArrayList<HashMap<String, String>>();
        for (RestCanvas restCanvas : restCanvasList) {
            HashMap<String, String> canvasDisplay = new HashMap<>();
// The below mcanvasid is what I would like to get when clicked
            canvasDisplay.put("mcanvasid", String.valueOf(restCanvas.getMcanvasid()));
            canvasDisplay.put("mcanvastitle", restCanvas.getMcanvastitle());
            canvasDisplay.put("mcanvasname", restCanvas.getMcanvasname());
            canvasDisplay.put("mcanvasimage", restCanvas.getMcanvasimage());
            canvaslist.add(canvasDisplay);
        }

        listView = (ListView) findViewById(R.id.canlist);

        lazyAdapter = new LazyAdapter(this, canvaslist);
        listView.setAdapter(lazyAdapter);

        listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> parent, View view,
                                    int position, long id) {
// In the for loop above, you can see the mcanvasid, which I would like to use here. 

            }
        });

    }
}

```

LazyAdapter.java :

```
  public class LazyAdapter extends BaseAdapter {

        private Activity activity;
        private ArrayList<HashMap<String, String>> data;
        private static LayoutInflater inflater=null;

        public LazyAdapter(Activity a, ArrayList<HashMap<String, String>> d) {
            activity = a;
            data=d;
            inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

        }

        public int getCount() {
            return data.size();
        }

        public Object getItem(int position) {
            return position;
        }

        public long getItemId(int position) {
            return position;
        }

        public View getView(int position, View convertView, ViewGroup parent) {
            View vi=convertView;
            if(convertView==null)
                vi = inflater.inflate(R.layout.activity_group_canvas, null);

            TextView canvasName = (TextView)vi.findViewById(R.id.canvasname); // id
            TextView canvasTitle = (TextView)vi.findViewById(R.id.canvastitle); // title
            ImageView canvasImage=(ImageView)vi.findViewById(R.id.canvasimage); // image

            HashMap<String, String> canvasList = new HashMap<String, String>();
            canvasList = data.get(position);

            canvasName.setText(canvasList.get(GroupCanvasActivity.mcanvasid));
            canvasTitle.setText(canvasList.get(GroupCanvasActivity.mcanvasname));
            canvasImage.setImageBitmap(convertByteArrayToBitmap(canvasList.get(GroupCanvasActivity.mcanvasimage)));
            return vi;
        }

        private Bitmap convertByteArrayToBitmap(String string){
            byte [] encodeByte= Base64.decode(string, Base64.DEFAULT);
            return BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
        }

    }

```

Any help would be nice. Thank you. :-)