frankish
frankish

Reputation: 6826

How to show Activity overlaying on another Activity?

I want to show a volume bar (SeekBar) when a speaker button is pressed. Changing the whole Activity just for a SeekBar might not be a good decision.

I think overlaying that SeekBar would be the best solution. (But how?)

How would you solve this problem?

Upvotes: 0

Views: 105

Answers (2)

a.bertucci
a.bertucci

Reputation: 12142

I think you should use a custom Dialog with a SeekBar set as content.

As a side note, remember to get rid of the title requesting the right feature to your window:

getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);

Upvotes: 0

android developer
android developer

Reputation: 116332

You could use your own customized dialog and automatically dismiss it if the user hasn't touched the screen after a short while, but I would like to ask exactly why you need it.

The reason: not all Android devices even have volume buttons.

If you wish, you can easily just set the volume control to be MEDIA instead of the ringtone volume, so that if the user accesses the volume , it will show the control of the MEDIA . Here's how you do it:

setVolumeControlStream(AudioManager.STREAM_MUSIC);

Upvotes: 1

Related Questions