Skip to content

Commit

Permalink
添加8.0适配
Browse files Browse the repository at this point in the history
  • Loading branch information
yaming116 committed Mar 8, 2018
1 parent e4df7d7 commit f23dcd6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ private void sendLocalBroadcast(int status, int progress) {
@TargetApi(26)
private void buildNotification() {
manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
builder = new NotificationCompat.Builder(this);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
CharSequence name = "update_channel";
String Description = "zhuojian update channel";
Expand All @@ -288,8 +289,8 @@ private void buildNotification() {
mChannel.enableVibration(true);
mChannel.setShowBadge(false);
manager.createNotificationChannel(mChannel);
builder.setChannelId(String.valueOf(notifyId));
}
builder = new NotificationCompat.Builder(this);
builder.setContentTitle(getString(R.string.update_app_model_prepare, appName))
.setWhen(System.currentTimeMillis())
.setProgress(100, 1, false)
Expand Down

0 comments on commit f23dcd6

Please sign in to comment.