-2

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();
                }
            }

        }
    }
}
tshepang
  • 12,111
  • 21
  • 91
  • 136

1 Answers1

0

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

Community
  • 1
  • 1
duggu
  • 37,851
  • 12
  • 116
  • 113