D deltacode Member Licensed User Longtime User Apr 15, 2013 #1 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Apr 16, 2013 #2 AppWidgetHost is used by home screen apps. I don't think that it is possible to delete your widget (or any other widget) programmatically. Upvote 0
AppWidgetHost is used by home screen apps. I don't think that it is possible to delete your widget (or any other widget) programmatically.
davidt Member Licensed User Longtime User Jun 20, 2016 #3 Could you please provide some sample code to show how you added the widget to the home screen? Upvote 0
DonManfred Expert Licensed User Longtime User Jun 20, 2016 #4 davidt said: Could you please provide some sample code to show how you added the widget to the home screen? Click to expand... https://www.yahoo.com/tech/how-to-add-android-widgets-to-your-phones-home-screen-85049692289.html Upvote 0
davidt said: Could you please provide some sample code to show how you added the widget to the home screen? Click to expand... https://www.yahoo.com/tech/how-to-add-android-widgets-to-your-phones-home-screen-85049692289.html
davidt Member Licensed User Longtime User Jun 23, 2016 #5 DonManfred said: https://www.yahoo.com/tech/how-to-add-android-widgets-to-your-phones-home-screen-85049692289.html Click to expand... 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
DonManfred said: https://www.yahoo.com/tech/how-to-add-android-widgets-to-your-phones-home-screen-85049692289.html Click to expand... 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
DonManfred Expert Licensed User Longtime User Jun 23, 2016 #6 davidt said: I am looking to add widgets programmatically to a custom launcher screen Click to expand... You cant. the user need to add the widget to his desktop manually Upvote 0
davidt said: I am looking to add widgets programmatically to a custom launcher screen Click to expand... You cant. the user need to add the widget to his desktop manually
davidt Member Licensed User Longtime User Jun 23, 2016 #7 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
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