Android Context 归因标记

归因标记

用于特别场景下需要区分context来源时使用

// 创建归因标记,简称Tag
attributionContext = createAttributionContext("initXXXSDK")

解析:
在Context类中的注释的解释如下:返回一个新的不同标记的上线文对象…来区分不同逻辑部分

    /**
     * Return a new Context object for the current Context but attribute to a different tag.
     * In complex apps attribution tagging can be used to distinguish between separate logical
     * parts.
     *
     * @param attributionTag The tag or {@code null} to create a context for the default.
     *
     * @return A {@link Context} that is tagged for the new attribution
     *
     * @see #getAttributionTag()
     */
    public @NonNull Context createAttributionContext(@Nullable String attributionTag) {
    
    
        ....
    }

猜你喜欢

转载自blog.csdn.net/u011106915/article/details/126676870