java - Pass MediaPlayer from Service to Activitiy with IPC -
i working on android app streams videos internet. therewith app able stream videos in background, hold media player in separate process' service. had tried run service , activity in same process, on 20% of smartphones service destroyed if press homebutton. hence process. question. how implement this? in main activity need access media player object of service setting display surfaceview.
// code have used before, when main activity // , service ran in same process @override public void onserviceconnected(componentname componentname, ibinder ibinder) { mediaplayerservice.localbinder localbinder = (mediaplayerservice.localbinder)ibinder; mvideoplayerservice = localbinder.getservice(); mvideoplayerservice.mplayer.setdisplay(readyholder);
i read using ipc - inter process communication. can solve ipc or if not, how possible?
thanks, mario
java android multithreading ipc inter-process-communicat
No comments:
Post a Comment