Skip to content
Snippets Groups Projects
SedentaryNotification.java 1.57 KiB
Newer Older
import android.annotation.TargetApi;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AppCompatActivity;


import com.example.pharmacy.frontEnd.MainActivity;
import com.example.pharmacy.frontEnd.R;

public class SedentaryNotification extends Notification {
    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    protected NotificationCompat.Builder setParameters(NotificationCompat.Builder builder) {
        //Get parameters from settings? or set strings?
        builder.setSmallIcon(0);
        builder.setContentTitle("");
            builder.setContentText("");
                return builder;

    @TargetApi(26)
    protected NotificationChannel setChannelParameters(NotificationChannel nc) {
        nc.setDescription("");
        nc.enableLights(true);
// Sets the notification light color for notifications posted to this
// channel, if the device supports this feature.
        nc.setLightColor(Color.RED);
        nc.enableVibration(true);
        nc.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
        return nc;