3

I'm creating a media player, in which the MediaPlayer is played in a Service.

Issue is I want to send the track duration progress to the SeekBar which is present in Activity's layout.

I stumbled upon several posts like this, but they all explain running the media inside the activity itself.

This is not a correct way, to continuously run a Thread within a UI thread.

I've not written the code yet, but I'm thinking to use AIDL, to update SeekBar from within Service class.

But is there any better way. Will be great if an example can be provided.

Thank You

Community
  • 1
  • 1
collin
  • 297
  • 1
  • 5
  • 11

1 Answers1

0

Won't it be easier for you to sendBroadcast from Service containing the value for your seekbar and in the Activity in broadcast onReceive method update the seekbar?

kroky
  • 195
  • 2
  • 14