Skip to content

Commit

Permalink
corrected example for API 26.
Browse files Browse the repository at this point in the history
  • Loading branch information
JimSeker committed Aug 24, 2017
1 parent 016f867 commit 06f64a0
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
Expand Down Expand Up @@ -82,16 +83,16 @@ private void createchannel() {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationChannel mChannel = new NotificationChannel(id,
getString(R.string.channel_name), //name of the channel
NotificationManager.IMPORTANCE_LOW); //importance level
NotificationManager.IMPORTANCE_DEFAULT); //importance level
//important level: default is is high on the phone. high is urgent on the phone. low is medium, so none is low?
// Configure the notification channel.
mChannel.setDescription(getString(R.string.channel_description));
// mChannel.enableLights(true);
mChannel.enableLights(true);
// Sets the notification light color for notifications posted to this channel, if the device supports this feature.
//mChannel.setLightColor(Color.RED);
// mChannel.enableVibration(true);
mChannel.setLightColor(Color.RED);
mChannel.enableVibration(true);
mChannel.setShowBadge(true);
//mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
nm.createNotificationChannel(mChannel);

}
Expand Down

0 comments on commit 06f64a0

Please sign in to comment.