Android:在状态栏中显示动画

时间:2018-11-29 07:03:54

标签: android android-studio android-service

我想通知用户该服务正在带有动画的状态栏中运行 但无法显示动画或颜色

我看到了这些问题,但没有解决我的问题:

How to animate the progress notification icon

Animation in Notification bar Custom View

Android - show animated status bar icon

    notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

    Notification.Builder builder = new Notification.Builder(this);
    builder.setAutoCancel(false);
    builder.setContentTitle(getText(R.string.app_name_persian));
//    builder.setContentText(getText(R.string.app_is_running));
    builder.setSmallIcon(R.drawable.notification_animation);
    builder.setOngoing(true);
    builder.setWhen(System.currentTimeMillis());

    notificationManager.notify(13, builder.build());

我的动画可绘制: enter image description here

我看到的是: enter image description here enter image description here

0 个答案:

没有答案