0

I am making a music player and i want the user to be able to quickly start stop skip the song without opening the application.

I have an original (unrooted) device and i see that some applications like CPU monitors can be opened over other applications in a small window. How do they do it? How can i do it? My app is for android:minSdkVersion="14" android:targetSdkVersion="17"

enter image description here

frankish
  • 6,738
  • 9
  • 49
  • 100
  • **"i see that some applications like CPU monitors can be opened over other applications in a small window."** - Give an example of apps that do this or a screenshot. It's not clear what you want to do. – Squonk May 27 '13 at 08:34
  • @Squonk I have added the screenshot, name of the app is "Android life monitor" – frankish May 27 '13 at 08:43
  • 1
    I'm not completely sure but it looks like it's using an `Activity` with a Dialog theme specifying `LayoutParams` to cause it to only use part of the screen. It's not something I've ever done but there was a question on StackOverflow in the last 24 hours about restricting size of an `Activity` to a small screen size this way. You'll need to fire it using a `PendingIntent` from the `Notification` bar. Sorry I can't give any more information than that. – Squonk May 27 '13 at 08:56
  • I found the question. The person asking it is using Mono but you can see how they're using positioning using the window's attributes from the code they posted. See http://stackoverflow.com/questions/16763508/activity-as-dialog-place-in-top-left-corner – Squonk May 27 '13 at 09:10

0 Answers0