title: Get Incoming call number in Android not working for Android Pie(9.0)
body: <p>This is the code I used to do my work, but unfortunately <strong>It doesn't work for my device with Android Pie(9.0)</strong>. But <strong>It works for device with Android Naugat(7.0)</strong>. I already enabled the phone permission for the app using device App Settings. Can you give me a solution for this?</p>
  
  <pre><code>import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  import android.telephony.TelephonyManager;
  import android.widget.Toast;
  
  public class MyReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
  
          Bundle extras = intent.getExtras();
          if(extras!=null){
              String state = extras.getString(TelephonyManager.EXTRA_STATE);
              if(state.equals(TelephonyManager.EXTRA_STATE_RINGING)){
                  String phoneNo = extras.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
                  Toast.makeText(context, "You Got A Call From " + phoneNo, Toast.LENGTH_SHORT).show();
              }
          }
      }
  }
  </code></pre>