android - Place voice call, to have inapp feel (or just hide the default phone disconnected UI) -
currently when place voice phone call through app entire screen taken call ui. there way enclose call feel dialog , provide margin's user need not remember press app, after call complete ?
basically dont want customer need remember press "back" button.
i using code below place call. instead of opening last activity, opening first launch screen. need hide.
edit :
phonecalllistener phonelistener = new phonecalllistener(); telephonymanager telephonymanager = (telephonymanager) .getsystemservice(context.telephony_service); telephonymanager.listen(phonelistener, phonecalllistener.listen_call_state); intent intent = new intent(intent.action_call); intent.setdata(uri.parse("tel:" + cabbiephonenumber)); intent.setflags(intent.flag_activity_new_task); startactivity(intent); i using phonestatelistener listening phone state.
private class phonecalllistener extends phonestatelistener { private boolean isphonecalling = false; string log_tag = "logging 123"; @override public void oncallstatechanged(int state, string incomingnumber) { if (telephonymanager.call_state_ringing == state) { // phone ringing log.i(log_tag, "ringing, number: " + incomingnumber); } if (telephonymanager.call_state_offhook == state) { // active log.i(log_tag, "offhook"); isphonecalling = true; } if (telephonymanager.call_state_idle == state) { // run when class initial , phone call ended, // need detect flag call_state_offhook log.i(log_tag, "idle"); if (isphonecalling) { log.i(log_tag, "restart app"); // restart app intent = getbasecontext().getpackagemanager().getlaunchintentforpackage( getbasecontext().getpackagename()); i.addflags(intent.flag_activity_clear_top); startactivity(i); isphonecalling = false; } } }
voice call without built-in call ui not possible sdk application. have roll own firmware achieve this.
Comments
Post a Comment