Search code examples
androidvolume

Trigger system volume bar


Is it possible by pressing a button in my Activity to make the volume bar appear? The volume bar is the view that appears when you press one of the hardware volume buttons.

Is there a API function to do this or do I have to recreate that view by hand?


Solution

  • if you call setStreamVolume, pass the flag FLAG_SHOW_UI See http://developer.android.com/reference/android/media/AudioManager.html#FLAG_SHOW_UI