Android adjust初始化分享

上次为大家分享了facebook的初始化程序,为了方便大家一步到位,现在为大家分享adjust的初始化程序。

直接上代码:

先创建一个MyApp的类在里面的onCreate中写下以下代码

  //初始化Adjust
        String environment = AdjustConfig.ENVIRONMENT_PRODUCTION;
        AdjustConfig config = new AdjustConfig(this, "1lvz3j6xf6jk", environment);
        config.setLogLevel(LogLevel.VERBOSE);
        this.registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks());
        Adjust.onCreate(config);
        super.onCreate();

在onCreate外添加下列代码

 public static final class AdjustLifecycleCallbacks implements ActivityLifecycleCallbacks {

        @Override
        public void onActivityCreated(@androidx.annotation.NonNull Activity activity, @androidx.annotation.Nullable android.os.Bund

你可能感兴趣的:(笔记,andriod,初始化,android,java,apache)