我有一部双卡手机,我需要在广播接收器中接听呼叫的号码(第一个或第二个)?如何获得电话号码?
我确实喜欢这样,但它不时有效
public class IncomingCall 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"){ }
else if(callingSIM =="1"){ }
}
}