问题
I have a problem. My receiver is run very succesfull but when on private numbers not work my code.
private class MyPhoneStateListener extends PhoneStateListener {
public void onCallStateChanged(int state, String incomingNumber) {
Log.d("MyPhoneListener", state + " incoming no:" + incomingNumber);
if (state == 1) {
Cursor numaralar = NumaralariGetir();
while (numaralar.moveToNext()) {
String numara = numaralar.getString(numaralar
.getColumnIndex("numara"));
if (incomingNumber.equals(numara)) { // DialedNumber
// checking.
abortBroadcast();
}
}
}
}
}
回答1:
See below link :-
how to block a mobile number call and message receiving in android application development?
http://blog.wangling.me/2009/08/why-it-is-impossible-to-intercept-incoming-calls-on-android.html
来源:https://stackoverflow.com/questions/23407358/how-to-catch-and-block-unknown-incoming-calls