java - Cant get the Id from listview right -


so have android app has listview populated sqlite database, im trying id of item when button click outputting 2 numbers not one. instead of answer being 5 5,1

heres method:

public void onclick(view view) {                 toast.maketext(view.getcontext(),"id of item: "+ myadapter.choreslist.get(postion),toast.length_short).show();                 //choreapp.dbmanager.deleteoneitem(i);             }         }); 

get id model class below code;

call getid() method model class;

public void onclick(view view) {             toast.maketext(view.getcontext(),"id of item: "+ myadapter.choreslist.get(postion).getid(),toast.length_short).show();             //choreapp.dbmanager.deleteoneitem(i);         }     }); 

Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -