Android push notification offline : <p>im trying to implement push notification in my app,already using GCM. But the case is i want it in the way which works offline too. 
i.e: for multiple conditions inside android app it should trigger push notification.</p>

<p>Currently im trying : </p>

<pre><code>NotificationManager mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.custom_notification);
contentView.setImageViewResource(R.id.image, R.drawable.ic_launcher);
contentView.setTextViewText(R.id.title, title);
contentView.setTextViewText(R.id.text, msg);
notification.contentView = contentView;

Intent notificationIntent = new Intent(this, HomeActivity.class);
PendingIntent contentIntent = PendingIntent.getActivity(this,randomNo, notificationIntent, 0);
</code></pre>

<p>But the problem is,
1.When the app doesnt running ,the notification arrives but it cases screen to blink(becoz i call it using intent).
2.i want to use same class for multiple conditions and forward it to different activities(currently i cant change the intent to another activity based on condtiop).</p>
