2

When the app receives a push message, I coded onMessage to launch the MainActivity with a alert dialog to popup the message. So far so good.

What I really want is the popup only! So when the user is busy with another app, it only shows a dialog with the options to cancel or launch app...

GCMIntentService part

@Override
    protected void onMessage(Context context, Intent intent) {
        Log.d(TAG, "Received a message");
        String message = intent.getExtras().getString("price");
        displayMessage(context, message);
        generateNotification(context, message);
        //Launch a activity
        Intent i = new Intent();
        i.putExtra("message", message);
        i.setClassName("nl.easy.winkel", "nl.easy.winkel.MainActivity");
        i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(i);
    }
Harry
  • 786
  • 1
  • 8
  • 27

0 Answers0