因为很长时间没用过通知了,客户端的通知也一直不是自己在负责的,所以想着复习一下。真正写了之后才发现android的通知已经有了很大的变化。

  //获取通知管理器        notificationManager= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);        RemoteViews remoteViews=new RemoteViews(getPackageName(),R.layout.notification_view);//通知的正文布局        //延时意图,点击通知后的跳转        PendingIntent pendingIntent=PendingIntent.getActivity(this,2,new Intent(this,SecondActivity.class),PendingIntent.FLAG_CANCEL_CURRENT);        NotificationCompat.Builder mBuilder=new NotificationCompat.Builder(this).setSmallIcon(R.mipmap.ic_launcher).setContentTitle("notification title")               .setContentText("text") .setContent(remoteViews).setContentIntent(pendingIntent);        notificationManager.notify(1, mBuilder.build());
由于时间关系,先写这么多,后期有时间再补充。。。

详细参考:android通知1 全面讲解通知

更多相关文章

  1. android中如何隐藏应用程序标题栏和通知栏
  2. Android(安卓)日期和时间选择控件的开发
  3. Android自带Music播放器更新播放时间和进度条的方法
  4. Android消息通知(notification)和PendingIntent传值
  5. Best Android(安卓)Remote Desktop Apps?
  6. Android消息通知(notification)和PendingIntent传值
  7. cordova的android notify消息通知插件
  8. Android(Java):Android的状态栏通知(Notification)
  9. Android(安卓)加快编译时间

随机推荐

  1. 初学Android,Android的项目结构(二)
  2. Android系列之浅谈AndroidGallery控件使
  3. Android图片堆叠效果实现
  4. Android之EditText
  5. 最新Android(安卓)SDK/ADT/NDK的下载位置
  6. Layout属性介绍
  7. Android(安卓)开发 修改app应用的名字和
  8. Android控件之TextView(显示文本框控件)
  9. Android(安卓)Edittext获取焦点后,弹出的
  10. Professional Android(安卓)2 Developmen