Widget Help Required

deltacode

Member
Licensed User
Longtime User
Hi,

Im writing my first app using B2A having written a couple using java.

The app goes like thus:
1) User chooses the widget and adds to the home screen. Done
2) On adding the widget i want it to open an activity of user options. Done
3) User makes changes which are reflected on the widget. Done
4) User save changes or exits activity. Done

What i want to happen is if the user decides to exit the activity without saving, then the widget is removed from the homescreen as though it had never been added.

I'm thinking possibly i may need to remove the widget using AppWidgetHost.

Can anybody help me please, i have seen this functionality in an app called Widgetsoid so it must be possible.
 

davidt

Member
Licensed User
Longtime User
Could you please provide some sample code to show how you added the widget to the home screen?
 
Upvote 0

davidt

Member
Licensed User
Longtime User
Thanks Manfred.
Apologies for not being very clear with my question. I am looking to add widgets programmatically to a custom launcher screen. I have resolved this now and am having the same issue as described in Post #1 - how to remove the widget. Erel's response in post #2 states that it can't be done programmatically so I'll have to rethink my design.
Regards,
Dave
 
Upvote 0

davidt

Member
Licensed User
Longtime User
Sorry, I am not being very clear again. I understand that the user initiates the process and selects the desired widget, but I am using the RSSmartWidgets library and I am controlling programmatically where the widget is placed when I add the AppWidgetHostView to the panel.
What I would like to understand is if it is possible to provide functionality for the user to remove the widget in the same manner as the standard android home screen allows. My custom launcher screen does not inherit this functionality by default (not that I expected it to). RSSmartWidgets contains a RemoveWidget method, but I am unable to get this to work.
I appreciate your time and patience Manfred
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…