phone call - Android - Disable options on a UI caller -


i'm developing app requires user needs inaccessible options when call automatically made... (for safety reasons)

so want erase (or disable) of options bellow:

enter image description here

is there way accomplish this?

you can't remove existing layout existing app or run calling in background (like hiding user). however, can create new dialer app , not open dialer screen. instead, can open new activity.

first of all, include permission in androidmanifest.xml

<uses-permission android:name="android.permission.call_phone" />

then, add function , use when want to.

/**  * opens new action_call intent instead of action_dial.  * @param num string representation of number calling  */ private void call(string num) {     try {         intent callintent = new intent(intent.action_call);         callintent.setdata(uri.parse("tel:" + num));         startactivity(callintent);     } catch (activitynotfoundexception e) {         log.e("sample call in android", "call failed", e);     } } 

note it's not calling startservice(callintent). starting new activity instead.

hope helps.


Comments