title: Firebase Notification and Data
body: <p>I am Creating an App using Firebase cloud messaging API... I am able to send notification and data to my client application from the server.
  But the problem is When the application is open the notification is not firing while the data appears (I Mean I logged it) It is not an issue. But when the application is closed, the notification is received, while I clicked on notification the activity is opened while I am not able to see the log data. I need to Update the data to a TextView..</p>
  
  <p>My MyFirebaseMessagingService :</p>
  
  <pre><code>public void onMessageReceived(RemoteMessage remoteMessage) {
          // TODO: Handle FCM messages here.
          // If the application is in the foreground handle both data and notification messages here.
          // Also if you intend on generating your own notifications as a result of a received FCM
          // message, here is where that should be initiated.
          Log.d(TAG, "From: " + remoteMessage.getFrom());
          Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
          Log.e("FROM", "From: " + remoteMessage.getFrom());
          String data = remoteMessage.getData().get("message");
          Log.e("KOIII", "Notification Message Body: " + remoteMessage.getNotification().getBody());
         // showNotificationS(remoteMessage.getNotification().getBody(),2);
          if(data.equals("true")){
              Log.e("DATA", "SUCCESS");
             // Fragment1.getInstace().updateTheTextView(data, data, data);
          }
      }
  </code></pre>
  
  <p>My manifest:</p>
  
  <pre><code>&lt;activity
              android:name=".SplashScreen"
              android:label="@string/app_name"
              android:launchMode="singleInstance"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".myHome"
              android:label="@string/app_name"&gt;
          &lt;/activity&gt;
  &lt;service android:name=".MyFirebaseMessagingService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.MESSAGING_EVENT"/&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
          &lt;service android:name=".FirebaseIDService"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT"/&gt;
              &lt;/intent-filter&gt;
          &lt;/service&gt;
  </code></pre>