Android Question Is it possible to check widget presence and if not install it?

jcredk

Member
Licensed User
Longtime User
Hi all,

I am developping an application that contains both activities application and a 1x1 widget.
The widget is used to ensure data freshness and accuracy independently from the application usage.

I was wondering if there is a way, when the application thus the first activity is loading, to check if a specific widget "is running" i.e. is put/installed onto one of the desktop screens and if not, to programmatically install it ?

For now I have a "workaround" check a sort of "semaphore file" made by the widget to detect if it is running, and just put a messagebox if not running, but I would like to improve this as much as possible :)

Thanks for any advice or comprable code you did ...

Jcredk
 

DonManfred

Expert
Licensed User
Longtime User
If you widgetservice is running then the widget is on desktop.
I think you cannot put a widget on desktop by code. The user have to do this...
 
Upvote 0
Top