how to know on which sim the incoming call is in my android app, in android studio. -
as can incoming call number in onreceive method using telephonymanager, there way number of receiving sim here? want both callers number , receivers number in app when call received . possible?
see below, work me.
public class incomingcallinterceptor extends broadcastreceiver { @override public void onreceive(context context, intent intent) { string callingsim = ""; bundle bundle = intent.getextras(); callingsim =string.valueof(bundle.getint("simid", -1)); if(callingsim == "0"){ // incoming call sim1 } else if(callingsim =="1"){ // incoming call sim2 } } }
Comments
Post a Comment