0

I am wanting to be able to start an activity of my app from anywhere in Android. I am wanting to do this by overlaying a button over any apps that are open.

How would I go about doing this, if it is possible.

Liam W
  • 1,193
  • 1
  • 26
  • 46
  • Even if you could, this is a really bad idea. How would you stop your button overlaying a key part of the other apps UI? – Simon Jul 28 '13 at 17:52
  • @roviuser no it wouldn't. I have seen another app do something similar. – Liam W Jul 28 '13 at 17:54
  • @Simon by making sure I only start the activity that shows the button when a specific app is open. – Liam W Jul 28 '13 at 17:54
  • OK, try this http://stackoverflow.com/questions/4481226/creating-a-system-overlay-always-on-top-button-in-android – Simon Jul 28 '13 at 17:57

2 Answers2

1

You can do it, without root or any modifications to the system, as Facebook clearly show with Chat Heads.

All you need is a special permission android.permission.SYSTEM_ALERT_WINDOW that lets you add windows with type TYPE_SYSTEM_ALERT that are displayed above other apps. Then, with some intimate knowledge of WindowManager, you can do practically anything you want.

It would be pretty difficult to do this for a specific app but probably not impossible.

Delyan
  • 8,881
  • 4
  • 37
  • 42
0

Surely you can do this. There's "Stand-Out" library available in GitHub. You can check it here - https://github.com/pingpongboss/StandOut

And this works super fine without root permission.

Vishnu Haridas
  • 7,355
  • 3
  • 28
  • 43