Android Wear Preview- 为通知添加多个页面(Adding Pages to a Notification)
来源:互联网 发布:如何求协方差矩阵 编辑:程序博客网 时间:2024/05/13 00:20
----------------------------------------------------------------------------------------------------------------------------------------------------------
原文作者:Google
原文地址:http://developer.android.com/wear/notifications/pages.html
原文版权:Creative Commons 2.5 Attribution License
译文作者:Jianan - qinxiandiqi@foxmail.com
版本信息:本文基于2014-06-24版本翻译
译文版权:CC BY-NC-ND 4.0,允许复制转载,但必须保留译文作者署名及译文链接,不得演绎和用于商业用途
----------------------------------------------------------------------------------------------------------------------------------------------------------
当你想要提供更多的信息又不想要求用户在手持设备上打开你的应用程序,你可以选择在Android Wear设备上为你的通知添加一个多个Page(页面)。附加的页面会立刻显示在主通知卡片的右边。更多关于如何使用和设计多页面的内容,请参考Design Principles of Android Wear。
当创建一个多页面的通知,从创建主通知(第一个页面),也就是你希望显示在手机或者平板上的通知开始。然后,使用addPage()方法一次添加一个页面,或者使用addPages()一次传递一个包含过个页面的Collection集合进去。
例如,下面的代码添加为通知添加了第二个页面:
// Create builder for the main notificationNotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) .setSmallIcon(R.drawable.new_message) .setContentTitle("Page 1") .setContentText("Short message") .setContentIntent(viewPendingIntent);// Create a big text style for the second pageBigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle();secondPageStyle.setBigContentTitle("Page 2") .bigText("A lot of text...");// Create second page notificationNotification secondPageNotification = new NotificationCompat.Builder(this) .setStyle(secondPageStyle) .build();// Create main notification and add the second pageNotification twoPageNotification = new WearableNotifications.Builder(notificationBuilder) .addPage(secondPageNotification) .build();
- Android Wear Preview- 为通知添加多个页面(Adding Pages to a Notification)
- 为通知添加更多页面(Adding Pages to a Notification)
- Android Wear Preview- 从通知上接收语音输入(Receiving Voice Input from a Notification)
- android Wearable-Adding Pages to a Notification and Stacking Notifications
- Android Wear 进阶 1 Adding Wearable Features to Notifications 添加手表特性到通知上
- Android Wear Preview- 归档通知(Stacking Notifications)
- Android N Preview Notification API (通知)
- Android Wear Preview- 创建通知(Creating Notifications for Android Wear)
- Android Wear Preview - 设计规范(Design Principles of Android Wear)
- Android Wear Preview - UI
- android wear第一个应用,创建 Notification
- android wear-创建Notification
- Android Wear Preview Program Overview
- Android Wear 开发入门——如何创建一个手机与可穿戴设备关联的通知(Notification)
- Android Wear 进阶 - 1 Notification
- <等待翻译>Android Wear 进阶 2.4 Adding Voice Capabilities 添加语音功能
- Android 实现通知栏显示多个notification
- 开始使用—Android Wear Developer Preview
- 腾讯2014校园招聘软件开发类笔试
- Raphael.js API之Raphael.pathIntersection(),Raphael.pathToRelative(),Set.clear(),Set.exclude(element)
- 怎么在左上角加各种选项(开始,游戏攻略,帮助之类的)
- 生成jar包后调用,出现java.lang.NoSuchMethod 分析
- HDU1540 Tunnel Warfare
- Android Wear Preview- 为通知添加多个页面(Adding Pages to a Notification)
- 判断单链表中是否有环,计算出环的首地址 C语言实现
- 希望我可以温柔的对待这个世界
- nginx反向代理时,X-Forwarded-For 如何设置
- getParameter和getAttribute的区别
- UVA 10140 - Prime Distance(数论)
- 黑马程序员-Sizeof与Strlen的区别与联系
- Android4.4对于sdcard权限的改动以及兼容性问题
- 了解UBOOT添加命令的执行流程