saintsad
4/16/2018 - 8:17 PM

Android Noti

        Notifi_M = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
            Intent intent = new Intent(MyService.this, MainActivity.class);
            PendingIntent pendingIntent = PendingIntent.getActivity(MyService.this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);

            Notifi = new Notification.Builder(getApplicationContext())
                    .setContentTitle("Content Title")
                    .setContentText("Content Text")
                    .setSmallIcon(R.mipmap.ic_launcher)
                    .setTicker("알람!!!")
                    .setContentIntent(pendingIntent)
                    .build();

            Notifi.defaults = Notification.DEFAULT_SOUND;
            Notifi.flags = Notification.FLAG_ONLY_ALERT_ONCE;
            Notifi.flags = Notification.FLAG_AUTO_CANCEL;
            Notifi_M.notify( 777 , Notifi);