android radio stream phone state speaker -



android radio stream phone state speaker -

i develop basic radio stream application service.after incoming phone call , radio stream go on sound play top speaker.i want play speaker.how ?

private final phonestatelistener phonelistener = new phonestatelistener() { @override public void oncallstatechanged(int state, string incomingnumber) { seek { switch (state) { case telephonymanager.call_state_ringing: { //pause if(backgroundaudioservice.mediaplayer!=null){ backgroundaudioservice.mediaplayer.pause();} log.i("pause","pause"); break; } case telephonymanager.call_state_offhook: { break; } case telephonymanager.call_state_idle: { //play if(backgroundaudioservice.mediaplayer!=null){ backgroundaudioservice.mediaplayer.setaudiostreamtype(audiomanager.stream_music); backgroundaudioservice.mediaplayer.start(); log.i("play","play"); } break; } default: { } } } grab (exception ex) { } } };

android stream radio speaker

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -