android - Adding long click on parameters -


main activity 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

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -