问题
I was thinking of making a small background utility, which detects when either phone receives an incoming call / user makes an outgoing call. Based on the action, the numeric dialpad is displayed automatically when the phone is taken away from the ear.
I know, how to detect the type of call, but then don't know, if it's possible to trigger an Intent action to ask android to open the dialpad programatically.
Pls suggest, if its possible and how.
Thanks Omkar Ghaisas
回答1:
yes it is posible create a broad cast reciever liten for incoming call then in onrecieve write down this code it will open a dial pad
Intent dial = new Intent();
dial.setAction("android.intent.action.DIAL");
dial.setData(Uri.parse("tel:"));
dial.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(dial);
and for broadcast and services read this http://www.vogella.de/articles/AndroidServices/article.html
also check
http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html
来源:https://stackoverflow.com/questions/9925076/automatically-open-dialpad-on-incoming-outgoing-call