You need to create an application for Android, which for incoming and outgoing calls, and during a conversation, will show a button. When you click on the button should show the phone number.
The button should appear on the right during calls and conversations. Just appear. How to make it appear only during a call and not all the time? And how to get the number of the subscriber with whom you are connected? Explain how to implement it?
The button itself, which displays information when pressed, is already there. It is only necessary that she appear at the right time, and you need to get the number of the person calling (so far you can only get your number)
telephonyManager.getLine1Number(); свой номер intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER); вообще ничего, не null а пустота intent.getExtras().getString("android.intent.extra.PHONE_NUMBER"); вылетает