Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top