【发布时间】:2014-07-24 20:22:01
【问题描述】:
我已经为 android 穿戴设备创建了一个项目。 我需要自定义可穿戴设备上的通知样式。有什么办法吗。
我的方法是
Intent displayIntent = new Intent(getApplicationContext(), CustomNotification.class);
PendingIntent displayPendingIntent = PendingIntent.getActivity(getApplicationContext(),
0, displayIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification =
new NotificationCompat.Builder(context)
.extend(new WearableExtender()
.setDisplayIntent(displayPendingIntent))
.build();
int notificationId = 001;
// Get an instance of the NotificationManager service
NotificationManagerCompat notificationManager =
NotificationManagerCompat.from(this);
notificationManager.notify(notificationId , notification);
但我没有收到通知。
有什么方法可以自定义我的自定义布局设计吗?
这是清单部分
<activity android:name="com.client.android.CustomNotification"
android:exported="true"
android:allowEmbedded="true"
android:taskAffinity=""
android:theme="@android:style/Theme.DeviceDefault.Light" />
【问题讨论】:
标签: android notifications android-notifications wear-os