SBJ
SBJ

Reputation: 4139

How to hide one activity screen (Dialog theme activity) above main screen and run hide activity in background?

My Project have two Screen in which Activity A and Activity B.

Activity A show full screen with some content and activity B show audio player.

i need to when user minimize the player then player screen Activity B hide and play audio in background. Show only A activity Screen...

Please check demo screen layout on these link

http://screencast.com/t/BM7GrVAli5E2

can anyone suggest me how its possible ?

Thanks

Upvotes: 0

Views: 1311

Answers (2)

Kevin Gaudin
Kevin Gaudin

Reputation: 9945

Your ActivityB should act like a remote command for a Service which will actually handle the music playing.

  • Invoke ActivityB
  • When user taps play, start the service
  • Close ActivityB, the service still plays music in the background

See this tutorial about implementing a mediaplayer service: http://www.helloandroid.com/tutorials/musicdroid-audio-player-part-ii

Upvotes: 1

Dmytro Danylyk
Dmytro Danylyk

Reputation: 19796

Instead of using Activity B, use android.widget.PopupWindow

Upvotes: 2

Related Questions