Copying widget items doesn't work as intended

Explain your issue here
Post Reply
dew
Posts: 35
Joined: Wed Apr 03, 2019 7:09 pm

Copying widget items doesn't work as intended

Post by dew » Sun Apr 07, 2019 7:31 pm

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 :(
Attachments
2.jpg
This is the error that I get after copy / clone.
2.jpg (45.94 KiB) Viewed 11761 times
1.jpg
This is the widget that I try to copy / clone.
1.jpg (56.85 KiB) Viewed 11761 times

User avatar
TrianguloY
Posts: 107
Joined: Thu Jan 24, 2019 9:46 am

Re: Copying widget items doesn't work as intended

Post by TrianguloY » Sun Apr 07, 2019 9:34 pm

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.

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Copying widget items doesn't work as intended

Post by Pierrot » Mon Apr 08, 2019 6:12 am

There's no real way to copy a widget. It needs three things:
  1. ask the remote app for existing data
  2. ask the remote app to create a new widget
  3. ask the remote app to import the data
1. is possible, but using a non standard interface. It only works for widget providers that supports it, that is: quite a few but among them are big players.
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.

dew
Posts: 35
Joined: Wed Apr 03, 2019 7:09 pm

Re: Copying widget items doesn't work as intended

Post by dew » Mon Apr 08, 2019 7:48 am

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 :)

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Copying widget items doesn't work as intended

Post by Pierrot » Mon Apr 08, 2019 8:31 am

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)

Post Reply