我正在广播接收器中创建一个新活动,并试图弄清楚如何在视图中显示动态文本。
public class CallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
if (TelephonyManager.EXTRA_STATE_RINGING.equals(state)) {
String incomingNumber = intent.getStringExtra(TelephonyManager.EXTRA_INCOMING_NUMBER);
SystemClock.sleep(1);
Intent myIntent = new Intent(context, CallerIdActivity.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_USER_ACTION);
context.startActivity(myIntent);
}
}
如何将incomingNumber 传递给我刚开始的活动显示的视图?