Android Context attribution tag

attribution tag

It is used when it is necessary to distinguish the source of context in special scenarios

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

Parsing:
The annotations in the Context class are explained as follows: return a new online context object with different tags...to distinguish different logic parts

    /**
     * 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) {
    
    
        ....
    }

Guess you like

Origin blog.csdn.net/u011106915/article/details/126676870