如果有人有想從android中的通話記錄中刪除撥號號碼的情況,我們在撥打哪種方式的時候會在廣播接收機上撥打電話。請提前幫助我。如何從android中的通話記錄中刪除撥號號碼?
public class IncommingCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context mContext, Intent intent) {
// Get the current Phone State
this.mContext = mContext;
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
callerPhoneNumber = intent.getExtras().getString("incoming_number");
if (state == null)
return;
// If phone state "Rininging"
if (state.equals(TelephonyManager.EXTRA_STATE_RINGING)) {
ring = true;
flag=0;
// Get the Caller's Phone Number
}
// If incoming call is received
if (state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {
callReceived = true;
flag=1;
}
// If phone is Idle
if (state.equals(TelephonyManager.EXTRA_STATE_IDLE)) {
// If phone was ringing(ring=true) and not
// received(callReceived=false) , then it is a missed call
if (ring == true && callReceived == false) {
flag=2;
}
}
你嘗試過這個http://stackoverflow.com/questions/16767671/delete-particular-log-from-call-log – 2014-02-12 06:54:10