NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);        Notification.Builder builder = new Notification.Builder(this);        Intent intent = new Intent(Main2Activity.this,ReceiveMailActivity.class);        PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, 0);        builder.setContentIntent(pendingIntent);        builder.setSmallIcon(R.drawable.logo);        builder.setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.logo));        builder.setAutoCancel(true);        builder.setContentTitle("悬挂式通知");        builder.setFullScreenIntent(pendingIntent, true);        mNotificationManager.notify(2, builder.build());

 亲测可用

更多相关文章

  1. android 通知 手机 媒体 数据库 更新
  2. Android状态栏通知
  3. android 9.0通知栏适配,可用通知栏,悬浮通知,震动,提示音,
  4. Android通知推送 ——采用MQTT协议实现Android推送
  5. Android(六)通知、样式、主题、HTML
  6. android notification通知栏及8.0适配

随机推荐

  1. android 倒影
  2. Android(安卓)自定义文本框(带图片)
  3. Android程序安装和卸载
  4. android 自动化测试 monkey
  5. android实现左右滑动菜单
  6. android 按钮的点击缩放
  7. Android录音功能和播放录音功能的示例源
  8. android 获取wifi 信号质量
  9. Android延时执行的几种方法
  10. Android的setTag