When copying widgets I always get errors that the object could not be found. Tapping the element then requires to re-configure the widget. This is not really a copy its like adding a fresh instance of the same widget with no configuration and additionally getting an error message.
Please have a look at the attached screenshots. In the first screen you see a Dash Clock widget. It simple and only contains a simple weather element. Copying the widget [[+] leads to the error seen in the second screen
Copying widget items doesn't work as intended
Copying widget items doesn't work as intended
- Attachments
-
- This is the error that I get after copy / clone.
- 2.jpg (45.94 KiB) Viewed 16108 times
-
- This is the widget that I try to copy / clone.
- 1.jpg (56.85 KiB) Viewed 16108 times
- TrianguloY
- Posts: 109
- Joined: Thu Jan 24, 2019 9:46 am
Re: Copying widget items doesn't work as intended
I was going to say that coping a widget properties is not possible because Android saves the information internally. However restoring a backup does restore the widgets properties (not always) so maybe there is a chance this is just a bug that can be fixed...not sure though.
Re: Copying widget items doesn't work as intended
There's no real way to copy a widget. It needs three things:
2. is possible using standard Android APIs
3. is possible using the same non standard interface, BUT it's uses to recreate the same widget, not a copy. There's no way to guaranty that the widget provider will support using the same set of data for two distinct widget.
For these reasons, I didn't spent too much effort on widget copy. It's reset to an invalid one.
- ask the remote app for existing data
- ask the remote app to create a new widget
- ask the remote app to import the data
2. is possible using standard Android APIs
3. is possible using the same non standard interface, BUT it's uses to recreate the same widget, not a copy. There's no way to guaranty that the widget provider will support using the same set of data for two distinct widget.
For these reasons, I didn't spent too much effort on widget copy. It's reset to an invalid one.
Re: Copying widget items doesn't work as intended
Ok, I understand. It's a bit strange that Android doesn't support standard API calls for 1 + 3. Because it would allow a preset manager and stuff. Really strange.
But if it's not too much effort to use the non-guaranteed non-standard interface for 1 + 3 would you eventually add this functionality as an option to the settings in case of widget copies, that widgets can be TRIED to be copied like this - with no guarantee that it's successful. But better try and fail than not try?
Thanks
But if it's not too much effort to use the non-guaranteed non-standard interface for 1 + 3 would you eventually add this functionality as an option to the settings in case of widget copies, that widgets can be TRIED to be copied like this - with no guarantee that it's successful. But better try and fail than not try?
Thanks
Re: Copying widget items doesn't work as intended
That's a bit problematic, hence the reason for the non implemented feature. The process is asynchronous and might lead to the app being stopped in the meantime, hence the context need to be saved, and that's boring. (lazyness here)