TopicsManager
  public
  
  final
  
  class
  TopicsManager
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.adservices.topics.TopicsManager | 
TopicsManager 为应用和广告 SDK 提供 API,用于在隐私环境中获取用户兴趣主题 数据保存方式
您可以使用 Context.getSystemService(Class) 和 TopicsManager 类获取 TopicsManager 的实例。
摘要
| 公共方法 | |
|---|---|
| 
        
        
        static
        
        
        TopicsManager | 
      get(Context context)
      用于创建 TopicsManager 实例的工厂方法。 | 
| 
        
        
        
        
        
        void | 
      getTopics(GetTopicsRequest getTopicsRequest, Executor executor, OutcomeReceiver<GetTopicsResponse, Exception> callback)
      返回主题。 | 
| 继承的方法 | |
|---|---|
公共方法
get
public static TopicsManager get (Context context)
用于创建 TopicsManager 实例的工厂方法。
| 参数 | |
|---|---|
| context | Context:要使用的Context此值不能为null。 | 
| 返回 | |
|---|---|
| TopicsManager | TopicsManager实例
 
 此值不能为null。 | 
getTopics
public void getTopics (GetTopicsRequest getTopicsRequest, Executor executor, OutcomeReceiver<GetTopicsResponse, Exception> callback)
返回主题。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_TOPICS
| 参数 | |
|---|---|
| getTopicsRequest | GetTopicsRequest:用于获取 Topics 的请求。
 此值不能为null。 | 
| executor | Executor:要运行回调的执行器。
 此值不能为null。
 回调和监听器事件通过此Executor,可让您轻松控制要
 。要通过
 可以使用Context.getMainExecutor()。
 否则,请提供分派给相应线程的Executor。 | 
| callback | OutcomeReceiver:在主题可用或出现错误后调用的回调。
 此值不能为null。 | 
| 返回 | |
|---|---|
| void | 此值不能为 null。 | 
| 抛出 | |
|---|---|
| IllegalStateException | 。 | 
