我在将我的应用程序与 Android auto 连接时遇到问题。它是用 Xamarin.Android 制作的。我将 XML 链接到 Android Manifest,但它仍然不起作用。
清单包含:
<meta-data android:name="com.google.android.gms.car.application" android:resource="@xml/automotive_app_desc" />
XML 包含:
<?xml version="1.0" encoding="UTF-8" ?>
<automotiveApp>
<uses name="notification"/>
</automotiveApp>
这就是我构建通知的方式:
NotificationCompat.Builder notificationBuilder = new
NotificationCompat.Builder(ApplicationContext);
notificationBuilder.SetSmallIcon(Resource.Mipmap.ic_push_icon)
.SetContentText(msg)
.SetWhen(timestamp)
.SetContentTitle(content)
.SetContentIntent(readIntent)
.Extend(new CarExtender()
.SetUnreadConversation(unReadConversation)
.SetColor(ApplicationContext.GetColor(Resource.Color.purple)))
.SetChannelId(Fields.CHANNEL_ID)
.AddAction(CreateActionFromRemoteInput(replyIntent,remoteInput));
mNotificationManager.Notify(conversation.Id, notificationBuilder.Build());
有什么建议么?谢谢。
编辑:我正在使用 minSdk 21 和 targetSdk 26
编辑:
我唯一的日志是:
[通知] 请参阅 setSound() 的文档,了解如何使用 android.media.AudioAttributes 来限定您的播放用例
[通知] 不推荐使用流类型进行音量控制以外的操作