Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I don't think you want to do <code>telephonyService.endCall()</code> in <code>getTeleService()</code>. You probably want to call that within the <code>onReceive</code> method instead.</p> <p>I'm not sure whether you want to reject all calls or only ones from certain numbers. If you are trying to only reject certain numbers, it looks like you don't have any code to check the number of the incoming call against the blocked numbers after retrieving it here:</p> <pre><code>public void onReceive(Context context, Intent intent) { Bundle b = intent.getExtras(); incommingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER); ---&gt;// Additional Step &lt;--- ---&gt;// Check whether this number matches with your defined Block List &lt;--- ---&gt;// If yes, Reject the Call &lt;--- } </code></pre> <p>You can try changing it to the following if you want to check the number and reject calls only from the blocked numbers:</p> <pre><code>public void onReceive(Context context, Intent intent) { Bundle b = intent.getExtras(); incommingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER); // Additional Step // Check whether this number matches with your defined Block List // If yes, Reject the Call for (int i=0; i&lt;blockedNumbers.length; i++) { if (incommingNumber.equals(blockedNumbers[i])) { telephonyService.endCall(); break; } } } </code></pre> <p>Or if you just want to reject all calls, it's even simpler:</p> <pre><code>public void onReceive(Context context, Intent intent) { telephonyService.endCall(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload