Get item contained in an item from a ListView when clicking item

0

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!

    
asked by anonymous 27.10.2018 / 18:33

1 answer

0

Change of plans! Instead of trying to get items from the ItemListView in the click, I passed the item ID clicked and in the following activity I made a query through it and used the data.

    
27.10.2018 / 20:26