我有一个视频播放活动,可以创建媒体会话,这样我就可以退出应用程序并使用当前播放的媒体查看正在进行的推荐卡片。我在文档后面已经实现了这一点,但问题是我想更改卡上的fastlane颜色和应用程序图标。我怎样才能做到这一点?由于--create schema
CREATE TABLE fields (ObjectId int , FieldNumber int , NotNull bit)
INSERT fields (ObjectId, FieldNumber, NotNull)
VALUES
(100,1,1),(100,2,1),(100,3,0),
(200,1,1),(200,2,1),(200,3,1)
CREATE TABLE Data1 (ObjectId int , Field1 int ,Field2 int ,Field3 int)
GO
CREATE TRIGGER [dbo].[tr_INSERT_UPDATE_Data1]
ON [dbo].[Data1]
AFTER INSERT, UPDATE
AS
IF EXISTS ( SELECT *
FROM inserted AS i
JOIN ( SELECT ObjectId, Field1,Field2,Field3
FROM (
SELECT ObjectId, CONCAT('Field',FieldNumber) AS colName,
CASE WHEN NotNull = 1 THEN 'NOT NULL' ELSE 'NULL' END AS NotNull
FROM fields
) AS s
PIVOT
(
MAX(NotNull)
FOR colName IN (Field1,Field2,Field3)
) AS p
) AS f
ON f.ObjectId = i.ObjectId
WHERE (f.Field1 = 'NOT NULL' AND i.Field1 IS NULL)
OR (f.Field2 = 'NOT NULL' AND i.Field2 IS NULL)
OR (f.Field3 = 'NOT NULL' AND i.Field3 IS NULL)
)
THROW 50001, 'Cannot insert NULL into a field marked NOT NULL',1
GO
--Tests
--1 insert good data
INSERT Data1 (ObjectId, Field1,Field2,Field3)
VALUES (100,1,2,3)
--2 NULL blocked for ObjectId 100, Field1 NULL
INSERT Data1 (ObjectId, Field1,Field2,Field3)
VALUES (100,NULL,2,3)
--3 NULL blocked for ObjectId 100, Field2 NULL
INSERT Data1 (ObjectId, Field1,Field2,Field3)
VALUES (100,1,NULL,3)
--4 insert good data (Field3 NULL permitted)
INSERT Data1 (ObjectId, Field1,Field2,Field3)
VALUES (100,1,2,NULL)
--4 multiple ObjectIds supported - NULL blocked for all ObjectId 200 fields
INSERT Data1 (ObjectId, Field1,Field2,Field3)
VALUES (100,1,2,3),
(200,NULL,NULL,NULL)
设置为活动,系统正在为我创建推荐。
我可以将一些样式传递给会话,或者唯一可能的方法是使用推荐构建器并为我自己创建推荐吗?
答案 0 :(得分:0)
您可以使用构建器设置徽章图标,也可以设置内容图像。
ContentRecommendation.Builder builder = new ContentRecommendation.Builder();
builder.setBadgeIcon(R.drawable.videos_by_google_icon)
builder.setContentImage(bitmap);