How to get caller ID without using CALL_LOG permissions

I'm trying to face the new limitation () by using this solution () and unfortunately the marked code (in blue) always returns null.


public class CustomBroadcastReceiver extends BroadcastReceiver {

private static final String TAG = "CustomBroadcastReceiver";

@Override public void onReceive(Context context, Intent intent) { Log.v(TAG, "WE ARE INSIDE!!!!!!!!!!!"); TelephonyManager telephony = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); CustomPhoneStateListener customPhoneListener = new CustomPhoneStateListener();

telephony.listen(customPhoneListener, PhoneStateListener.LISTEN_CALL_STATE);

Bundle bundle = intent.getExtras(); String phoneNr= bundle.getString("incoming_number"); Log.v(TAG, "phoneNr: "+phoneNr); }

According to these new restrictions, my application will be removed from google play store and I will be forced to close my project.
I need an idea of how to get the phone number on a current phone call, don't need to get call log, only the current.

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by angie.schimmel
4 hours ago
Last post by mstehr
4 hours ago
Last post by ines17
1 hour ago
Last post by hermann07
4 hours ago
Last post by eino63
1 hour ago
Last post by pete38
4 hours ago
Last post by mabel.kozey
1 hour ago