How to link a widget Button to interact with in app ListView - Android -


i new android programming , understand how can done make communicating button widget , in app variables. example:

i have widget button if pressed 10 times result in listview 10 entries when open application. data insert local time. here's i'm trying do:

df = new simpledateformat("yyyy.mm.dd g 'at' hh:mm:ss z"); date = df.format(calendar.getinstance().gettime());  adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, listitems); listview.setadapter(adapter);  widgetbutton.setonclicklistener(new view.onclicklistener() {     public void onclick(view v) {         listitems.add(date);         adapter.notifydatasetchanged();     } }); 

i know it's wrong can't immagine other way. help?


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -