谷歌2017 I/O开发者大会今年将于5月17-19日在美国加州举办。大会将跟往年一样发布最新的 Android 系统,今年为 Android 8.0。谷歌在今年3 月21日发布 Android 新系统开发者预览版时已给新系统取名为 Android O。自2008 年发布以来, Android 依靠 Google 的生态运作,全球市场份额在2016年底已超过85% 。而近几年依靠 Android 发展起来的智能手机厂商不断增加, Android 生态大家庭也正在不断壮大。
创建通知渠道的步骤:
创建 NotificationChannel 对象,并设置应用内唯一的通知 ID。配置通知渠道的属性,比如提示声音等。在 NotificationManager 中注册通知渠道对象。 /** * 创建渠道 * @param channelId 渠道id * @param channleName 渠道名 * @return */ public static NotificationChannel createNotificationChannel(String channelId, String channleName) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { // The id of the channel. String id = channelId; // The user-visible name of the channel. CharSequence name = channleName; // The user-visible description of the channel. String description = "channel_description"; int importance = NotificationManager.IMPORTANCE_LOW; NotificationChannel channel = new NotificationChannel(id, name, importance); // Configure the notification channel. channel.setDescription(description); channel.enableLights(true); // Sets the notification light color for notifications posted to this // channel, if the device supports this feature. channel.setLightColor(Color.BLUE); channel.enableVibration(true); channel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); channel.setShowBadge(true); return channel; } return null; }在android 8.0中,当你创建一个通知时,必须指定该通知所归属的渠道,否则通知无法显示
/** * 创建通知 * @param context * @param title 通知标题 * @param content 通知 t); builder.setSmallIcon(R.mipmap.ic_launcher);// 设置图标 builder.setContentTitle(title);// 设置通知的标题 builder.setContentText(content);// 设置通知的内容 builder.setChannelId(channelId);//设置channelid return builder.build(); } return null; }当你需要使activity进入画中画模式时,只需要调用该activity的enterPictureInPictureMode()方法,此时activity会显示为一个比较小的窗口,并且该activity的onPause()方法会被调用, 处于pause状态.
https://developer.android.google.cn/preview/api-overview.html?hl=zh-cn
http://www.cnblogs.com/qyun/p/6715195.html