Android displaying floating widget overlay not working
Tested both Your code and mentioned blog post's code. The problem seems to be because You have used ConstraintLayout
and CardView
in Your layout.
For widget behavior, these view types are not supported. When we add view directly to the system window they behave likes RemoteViews
. As soon as You change ConstraintLayout
and CardView
, Your layout becomes visible and operable.