android - Adding long click on parameters -
made app user can stream songs froma n artist. in building app used onclick attribute time . want implement long click on each artist's name , toast can popup them. can me in having longclick option . in advance.
simply on listview, add following code long click on each item of list view:
listview.setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @override public boolean onitemlongclick(adapterview<?> parent, view view, int position, long id) { return false; } });
for linear layout, may use code:
linearlayout= (linearlayout)findviewbyid(r.id.linearlayout); linearlayout.setonlongclicklistener(new view.onlongclicklistener() { @override public boolean onlongclick(view v) { return false; } });
thanks, let me know if need more help.
Comments
Post a Comment