Yes it is possible. You do not say that you use to create a GridView. The following is an example of obtaining data by the cursor when you click on a grid cell (and including it in the intent to trigger another action):
gridview.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { Cursor c = (Cursor) (parent.getAdapter().getItem(position)); Intent i = new Intent(mCtx, ScheduleEdit.class); i.putExtra("RowId", position); i.putExtra("Machine", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_MACHINE))); i.putExtra("Priority", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_PRIORITY))); i.putExtra("RunJob", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_RUNJOB))); i.putExtra("Operator", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_OPERATOR))); i.putExtra("NxtJob1", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_NXTJOB1))); i.putExtra("NxtJob2", c.getString(c .getColumnIndex(ScheduleDBAdapter.SCHEDULE_NXTJOB2))); startActivityForResult(i, ACTIVITY_EDIT); } });
Barak source share