我正在编写一个应用程序,其中我有两个活动和一个服务。现在我想通过主要活动从服务中获取一些值并将这些值发送到第二个活动。基本上我想从服务中获取一个字符串数组并将该数组发送到下一个活动。我知道我可以在 Intent.putextra() 的帮助下将该 sring 数组发送到下一个活动。但我不知道如何从后台运行的服务中获取字符串数组。请帮帮我。。谢谢。。
1165 次
1 回答
1
public class ResponseReceiver extends BroadcastReceiver {
public static final String ACTION_RESP = "com.mamlambo.intent.action.MESSAGE_PROCESSED";
@Override
public void onReceive(Context context, Intent intent) {
// Update UI, new "message" processed by SimpleIntentService
String text = (String)intent.getStringExtra(Login.PARAM_OUT_MSG);
}
}
于 2011-06-29T13:29:29.493 回答