package kr.ac.pusan.walkover.autotrackingcctv.fcm;

import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.support.v4.app.NotificationCompat;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

import kr.ac.pusan.walkover.autotrackingcctv.MainActivity_login;
import kr.ac.pusan.walkover.autotrackingcctv.R;

/**
 * Created by soeun on 2017-08-16.
 */
public class MyFirebaseMessagingService extends FirebaseMessagingService {
    private static final String TAG = "MyFirebaseMessagingService";
    private String msg;

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        sendNotification(remoteMessage.getData().get("message"));

//        super.onMessageReceived(remoteMessage);
//        Log.d(TAG, "from: " + remoteMessage.getFrom());
//
//        if (remoteMessage.getData().size() > 0) {
//            Log.d(TAG, "Message data payload: " +remoteMessage.getNotification().getBody());
//        }
//
//        if (remoteMessage.getNotification() != null) {
//            Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
//        }

//        msg = remoteMessage.getNotification().getBody();
    }

    private void sendNotification(String messageBody) {
        Intent intent = new Intent(this, MainActivity_login.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,
                PendingIntent.FLAG_ONE_SHOT);

        Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
        NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                .setSmallIcon(R.mipmap.ic_launcher)
                .setContentTitle("FCM Push Test")
                .setContentText(messageBody)
                .setAutoCancel(true)
                .setSound(defaultSoundUri)
                .setContentIntent(pendingIntent);

        NotificationManager notificationManager =
                (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

        notificationManager.notify(0, notificationBuilder.build());
    }

}

@@ -456,34 +456,17 @@
 ingcctv.
-MainActivity_login
+R
 ;%0Aimport
@@ -504,17 +504,32 @@
 ingcctv.
-R
+ui.LoginActivity
 ;%0A%0A/**%0A 
@@ -1487,18 +1487,19 @@
 t(this, 
-Ma
+Log
 inActivi
@@ -1504,14 +1504,8 @@
 vity
-_login
 .cla

Remove MyFirebaseMessagingService's remaining MainActivity_login