title: I received notification from firebase but how can i display these messages of notification and transfer it to my mainlayout?
body: <p>This is code of firebase messaging service:</p>
  
  <pre><code>public class MyFirebaseMessagingService extends FirebaseMessagingService{
  private static final String TAG="MyFirebaseMsgService";
  
  @Override
  public void onMessageReceived(RemoteMessage remoteMessage) {
      Bundle bundle = new Bundle();
      bundle.putString("msgBody", remoteMessage.getNotification().getBody());
  
      Intent new_intent = new Intent();
      new_intent.setAction("ACTION_STRING_ACTIVITY");
      new_intent.putExtra("msg", bundle);
      sendBroadcast(new_intent);
      Log.d(TAG,"FROM:"+remoteMessage.getFrom());
      //check if the message contains data
      if(remoteMessage.getData().size()&gt;0){
          Log.d(TAG,"Message data:"+remoteMessage.getData());
  
          //check if the message contains notification
          if(remoteMessage.getNotification()!=null){
              Log.d(TAG,"Message body:"+remoteMessage.getNotification().getBody());
              sendNotification(remoteMessage.getNotification().getBody());
  
          }
      }
  }
  </code></pre>
  
  <p>/*
  * display notification This is code to display notification This is code to display notification This is code to display notification
  * */</p>
  
  <pre><code>private void sendNotification(String body) {
      Intent intent=new Intent(this,MainActivity.class);
      intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
      PendingIntent pendingIntent=PendingIntent.getActivity(this,0/*request code*/,intent,PendingIntent.FLAG_ONE_SHOT);
      //set sound notification
      Uri notifictaionSound= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
               NotificationCompat.Builder notifiBuilder=new 
               NotificationCompat.Builder(this)
              .setSmallIcon(R.mipmap.ic_launcher)
              .setContentTitle("Firebase Cloud Messaging")
              .setContentText(body)
              .setAutoCancel(true)
              .setSound(notifictaionSound)
              .setContentIntent(pendingIntent);
      NotificationManager notificationManager=
      (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
      notificationManager.notify(0/*ID of 
      notification*/,notifiBuilder.build());
  
  }
  </code></pre>