Notification通知界面可以用自己定义的界面来显示。下面是我实现的带进度条的通知效果

下面是主要实现部分代码,比较简单直接看代码可以了。
nf =new Notification(R.drawable.icon,"带进度条的提醒",System.currentTimeMillis()) ;
nf.icon = R.drawable.icon;
nf.contentView= new RemoteViews(this.getPackageName(),R.layout.notification);
nf.contentView.setProgressBar(R.id.ProgressBar01, 100, 0, false);
nf.contentIntent=PendingIntent.getActivity( this, 0, new Intent(this,remoteview.class) ,0);
实现带进度条的通知效果
本文介绍了如何在Android应用中创建一个带有进度条的通知界面,包括通知的基本设置、使用RemoteViews进行视图定制以及设置进度条的具体步骤。
649

被折叠的 条评论
为什么被折叠?



