将数据从意图服务传递到活动

use*_*145 5 android android-intent

我有一个广播接收器,从中调用 intentservice。我想将在 intentservice 中收到的数据发送到活动。字符串 s=extras.getString("Notice")。我想将此收到的字符串发送到新活动

小智 1

@Override
protected void onHandleIntent(Intent arg0) {
   Intent dialogIntent = new Intent(getBaseContext(), myActivity.class);
    dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
     dialogIntent.putExtra("value", extras.getString("Notice"));
     getApplication().startActivity(dialogIntent);
}   
Run Code Online (Sandbox Code Playgroud)