Android 定制android通知(Notification)
2010-08-25 23:59:00 来源:WEB开发网Notification通知界面可以用自己定义的界面来显示。下面是我实现的带进度条的通知效果
下面是主要实现部分代码,比较简单直接看代码可以了。
Java代码
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);
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);
更多精彩
赞助商链接