我们从android应用启动了一个电话:
Intent callIntent = new Intent(Intent.ACTION_CALL);
callIntent.setData(Uri.parse("tel:+19549545566"));
callIntent.putExtra("passUniqueVariable","1232453445");
startActivity(callIntent);
我们有一个挂接,等待呼叫状态更改,例如:
public abstract class PhonecallReceiver extends BroadcastReceiver {
public void onReceive(Context context, Intent intent) {
intent.getExtras().getString("passUniqueVariable")); // something like this
} }
有什么方法可以在onReceive函数内部接收作为变量“ passUniqueVariable”传递给Call Intent吗? 还是要从TelephonyManager获得该值?