java - Service + activity for playing music -
i created simple music play want play in background, don't know if solution correct:
- service (for playing music)
- activity fragment (for control)
but when easy play/stop/pause (getcurrentposition , exchange data), there huge problem seekbar runtime.
when can send position via bundle, changing seekbar runtime nothing me.
can tell me solution?
the easiest way declare broadcastreceiver
inside service , activity use localbroadcastmanager.getinstance(this).sendbroadcast(intent);
send data service. other way bind service activity , data directly. there no conflict between onstartcommand , onbind methods. can start service onstartcommand , bind later.
Comments
Post a Comment