which piece of code you need to insert to the program (or game) stopped when they call
Closed due to the fact that the essence of the question is not clear to the participants of Yuri , fori1ton , pavel , Pavel Parshin , rjhdby Jan 23 '17 at 7:43 .
Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .
|
1 answer
In order to receive an incoming call alert, you need to override PhoneStateListener and add it to TelephonyManager using TelephonyManager.listen () :
manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); telephonyManager.listen(listener,PhoneStateListener.LISTEN_CALL_STATE); If you need a phone number, request perm:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/> |