@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Intent notificationIntent = new Intent(this, Servicecancel.class);
PendingIntent contextIntext = PendingIntent.getService(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
Notification notification = new Notification(R.drawable.ic_launcher,"서비스 실행중",System.currentTimeMillis());
notification.setLatestEventInfo(getApplicationContext(), "어플", "불루투스 실행중", null);
startForeground(NOTIFICATION_ID, notification);
return Service.START_REDELIVER_INTENT;
}
Notification에서 취소버튼을 클릭시 앱을 종료하고 싶은데
현재까지는 이렇게 구성했습니다. 여기서 어떻게 추가를 해야할지 몰라서 이렇게 올립니다.