My situation is as follows, my listView loads the items into an xml that I created for each listVIew item
Atthetimethelistinglookslikethis: What I want to do is to click on these items circled in red, either by the Id, or in any way, and send to another activite, but so far I have managed to get the ID of each item in the listView. / p>
Method to load bank data:
public Cursor loadData(){
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.query(TableEstructure.Table.TABLE_NAME,null,null,null,null,null,null,null);
return cursor;
}
Method to load the data in the listView:
public void loadRegisters(){
db = new DataBase(MainActivity.this);
String[] from = {
TableEstructure.Table.COLUMN_ID,
TableEstructure.Table.COLUMN_DATE,
TableEstructure.Table.COLUMN_STATE,
TableEstructure.Table.COLUMN_CUTED_TREES,
TableEstructure.Table.COLUMN_VOLUME_CUTED_TREES};
int[]to = {R.id.txtId,
R.id.textState,
R.id.textDate,
R.id.textCutedTrees,
R.id.txtVolCutTree};
SimpleCursorAdapter simpleCursorAdapter = new SimpleCursorAdapter(getApplicationContext(),R.layout.item_list,db.loadData(),from,to);
list.setAdapter(simpleCursorAdapter);
}
Does anyone have the solution to my problem? Thank you very much!