I have problem my MainActivity can be created by 3 ways: 1) standart launch App 2) from Service 3) from notification click. How I can check when it starts from notification click?
Notification code:
private void createNotification()
{
    Log.d("service createNotification",MainActivity.TAG);
    Context context = getApplicationContext();
    Intent notificationIntent = new Intent(this,MainActivity.class);
    intent.putExtra(AppNames.IS_NOTIFICATION_INTENT,true);
    PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
            notificationIntent, Intent.FLAG_ACTIVITY_NEW_TASK);
    NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
            .setContentTitle(this.getString(R.string.notification_title))
            .setContentText(this.getString(R.string.notification_text))             
            .setContentIntent(pendingIntent)             
            .setSmallIcon(R.drawable.ic_launcher);
    getSystemService(Context.NOTIFICATION_SERVICE);
    notificationManager.notify(AppNames.APP_NOTIFICATION, builder.getNotification());
}
 
     
     
    