-1

What Clean Master app does is that it put a widget on home screen and when user tap it , it cleans RAM and show an animation like this on homescreen(on top of homescreen) - enter image description here

and i also want to do this ....

What i have done till now is that i have created a widget on homescreen and when user taps i received it inside an AppWidgetProvider class . shown here

I also think it shows this animation by using this feature - WindowManager.LayoutParams.TYPE_SYSTEM_ALERT , like what messenger did by overlaying chatheads on top of screen. This can be done like this - here.

But i am still confused on what would be the best approach for doing this.

Any help would be appreciated ! Thanks in advance.

Community
  • 1
  • 1
Devansh Kumar
  • 1,552
  • 1
  • 15
  • 27

1 Answers1

0

It is possible to create Activities with transparent backgrounds. These activities will appear over the homescreen but will still show the homescreen behind it. When the App Widget receives a broadcast, it can create a PendingIntent to start this transparent activity, which will then be displayed over the fullscreen.

hellowill89
  • 1,538
  • 2
  • 15
  • 26