Is it possible to create a widget and not have layout.What i mean is when created in the home screen and gets pressed, not to open and show you a layout, but to execute the code provided e.g if you have written a code about an alarm, when you press the widget directly from the home screen to make "on" the specific time alarm that you will have set,and not to transfer you to a layout and afterwards press a button.

有帮助吗?

解决方案

When you press on a widget, the system simply calls the PendingIntent you passed to the widget when setting it up.

It is up to you how you handle that intent.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top