android - 将数据从 Intent 服务传递到 Activity

标签 android android-intent

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

最佳答案

@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);
}   

关于android - 将数据从 Intent 服务传递到 Activity ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25928804/

相关文章:

android - 从浏览器启动 Android 应用程序

android - 非内置应用程序的隐式 Intent

将 admob 原生广告添加到回收站 View 后,Android 获得正确的项目位置

android - 程序在 android 启动画面后不工作

Android:是否可以将存储在 Google Cloud Storage 中的图像分享到 Instagram?

android - 无法在 iPhone 上获得完美的方形提交按钮。此外,按钮文本不居中

java - 从 XML 文件添加的 View 未显示在其父 View 中

android - 在 Android 上持久化数据的建议?

android - 有没有办法在 TabHost 中显示 fragment ?

android - 第一次加载后如何将数据传递给单个任务 Activity