Replace native outgoing call Screen by custom screen android -
i trying launch custom screen on top of native outgoing caller screen may contain full screen image of caller , buttons actions reject call. using able make call, redirecting me native caller screen...
how replace\override
default call screen custom screen screen?
startactivity(new intent(intent.action_call, uri.parse("tel:" + phonenumber))); public class getoutgoingnumber extends broadcastreceiver { final static string intent_phone_number = "android.intent.extra.phone_number"; @override public void onreceive(context context, intent intent) { // todo auto-generated method stub log.v("dilebroadcastreceiver","in onreceive()"); if (intent.getaction().equals(intent.action_new_outgoing_call)) { new handler().postdelayed(new runnable() { @override public void run() { intent = new intent(context, outgoingscreen.class); i.putextras(intent); i.addflags(intent.flag_activity_new_task); i.addflags(intent.flag_activity_single_top); context.startactivity(i); } }, 1000); }
here outgoingscreen displaying outgoing screen
public class outgoingscreen extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.outgoingscreen ); } }
now problem is showing screen few msec , again showing native screen....?
write receiver outgoing call
public class outgoingcallreceiver extends broadcastreceiver { @override public void onreceive(final context context, final intent intent) { //write intent yout page } }
add these manifest
<uses-permission android:name="android.permission.process_outgoing_calls" /> <uses-permission android:name="android.permission.read_phone_state" /> <receiver android:name=.outgoingcallreceiver" > <intent-filter> <action android:name="android.intent.action.new_outgoing_call" /> </intent-filter> </receiver>
add below theme activity theme
android:theme="@android:style/theme.translucent.notitlebar.fullscreen"
open intent after 1 second bcoz original outgoing call screen takes 800ms open need on lay screen, must call intent after 800ms. works me.
Comments
Post a Comment