Commit 1c3b1433 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added click action to the notification

parent be8286a2
package com.frostnerd.dnsserver.services;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.NonNull;
......@@ -8,6 +9,7 @@ import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import com.frostnerd.dnsserver.R;
import com.frostnerd.dnsserver.activities.MainActivity;
import com.frostnerd.dnsserver.database.entities.main.DNSServerSetting;
import com.frostnerd.dnsserver.server.DNSServer;
import com.frostnerd.dnsserver.server.TCPServer;
......@@ -37,6 +39,7 @@ public class ServerService extends NotificationService {
super.onCreate();
notificationBuilder = new NotificationCompat.Builder(this, Util.createNotificationChannel(this, false));
notificationBuilder.setContentTitle(getString(R.string.app_name));
notificationBuilder.setContentIntent(PendingIntent.getActivity(this, 10, new Intent(this, MainActivity.class), PendingIntent.FLAG_ONE_SHOT));
notificationBuilder.setSmallIcon(R.mipmap.ic_launcher);
notificationBuilder.setOngoing(true);
notificationBuilder.setAutoCancel(false);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment