I have 2 records in my sqlite database with different keys and I have two widgets of my app in android home. My widget content is a textview. This textview shows the record assigned to this widget in sqlite.
I have a form named widgetopen with an edittext that rises up when I click on my widget. I want to code this app as follows:
- When I click on a widget then show the widgetopen form with the edittext content equals the textview content for that widget
- And when I close the widget then the sqllite should be updated with new content of the edittext and the widget assigned has to be updated.
I have implemented this, but i have a 2 problems:
- How do I assign a widget with my record id in the database. I don’t have an idea where I have to save the record id in the widget
- After update editext content in widgetshow form and update database, how to update only the widget that assigned with the record id (actually the widget that clicked on it and popup widgetshow).
i save it on sharedpreferences and my problem solved.
i save every widget id with recrord id that assigned with it.