小编Ris*_*gal的帖子

如何将变量从notificationmanager传递给android中的一个活动

我在通知管理器中调试一个变量,因为第一次意图成功运行但第二次当我意图新消息时,活动显示thr perivous值plz帮助我实际上是一个大问题

  1. 这是通知管理器的代码
public class GCMIntentService extends GCMBaseIntentService {

    private static final String TAG = "GCMIntentService";

    public GCMIntentService() {
        super(SENDER_ID);
    }

    @Override
    protected void onRegistered(Context context, String registrationId) {

        Log.i(TAG, "Device registered: regId = " + registrationId);

        displayMessage(context, "Your device registred with GCM");

        Log.d("NAME", MainActivity.name);

        ServerUtilities.register(context, MainActivity.name, MainActivity.email, registrationId);
    }

    @Override
    protected void onUnregistered(Context context, String registrationId) {

        Log.i(TAG, "Device unregistered");

        displayMessage(context, getString(R.string.gcm_unregistered));

        ServerUtilities.unregister(context, registrationId);
    }

    @Override
    protected void onMessage(Context context, Intent intent) {

        Log.i(TAG, "Received message");

        String message = …
Run Code Online (Sandbox Code Playgroud)

android notificationmanager

1
推荐指数
1
解决办法
6264
查看次数

标签 统计

android ×1

notificationmanager ×1