How can I get to know if there's enough space left for a widget to be pinned on current launcher?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How can I get to know if there's enough space left for a widget to be pinned on current launcher?

李嘉琪
Apps had been allowed to request to pin an app widget on the current launcher since API level 26. As developers, this gave us a chance to make such request in our own Apps. However, the document says "When a request is denied by the user, the caller app will NOT get any response." Sometimes when there isn't enough room for a widget on the current launcher, the caller app will NOT get any response either.
How to differentiate between these two scenarios? Is there any callback function I can use? Is there any way I can get how much space left on the current launcher?

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/f32a41c8-1520-4471-8c58-e5f207973a0fn%40googlegroups.com.