How to download a file after clicking a button (Android Studio) -
i created activity in app. wanted user download .pdf file when he/she wants view guidelines. wanted implement on button. idea how properly? heres code below: public class exhibitor_registration_activity extends appcompatactivity { button buttondownload; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_exhibitor_registration_); this.settitle("buyer registration"); toolbar mytoolbar = (toolbar) findviewbyid(r.id.my_toolbar); setsupportactionbar(mytoolbar); getsupportactionbar().setdisplayhomeasupenabled(true); mytoolbar.setnavigationicon(r.drawable.ic_arrow_back_white_24dp); final button buttondownload = (button) findviewbyid(r.id.buttondownload); buttondownload.setonclicklistener(new view.onclicklistener(){ @override public void onclick(view view) { try {