Service stopForeground(false);
/**
* 通知作成
*/
private void createNotification() {
// Android8以上通知表示
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Context context = getApplicationContext();
Intent openUi = new Intent(context, MainActivity.class);
openUi.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
openUi.setAction(Intent.ACTION_MAIN);
openUi.addCategory(Intent.CATEGORY_LAUNCHER);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0x01, openUi, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, mAppName, NotificationManager.IMPOR