content: package info.meizi_retrofit;
  
  import android.annotation.TargetApi;
  import android.app.Application;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Build;
  import android.support.multidex.MultiDex;
  
  import com.avos.avoscloud.AVOSCloud;
  import com.tencent.bugly.Bugly;
  import com.tencent.bugly.beta.Beta;
  import com.tencent.tinker.loader.app.DefaultApplicationLike;
  
  import info.meizi_retrofit.utils.PicassoHelper;
  import io.realm.Realm;
  
  /**
   * Created by wp on 2017/8/20.
   */
  
  public class SampleApplicationLike extends DefaultApplicationLike {
  
      public static final String TAG = "Tinker.SampleApplicationLike";
  
      public SampleApplicationLike(Application application, int tinkerFlags,
                                   boolean tinkerLoadVerifyFlag, long applicationStartElapsedTime,
                                   long applicationStartMillisTime, Intent tinkerResultIntent) {
          super(application, tinkerFlags, tinkerLoadVerifyFlag, applicationStartElapsedTime, applicationStartMillisTime, tinkerResultIntent);
      }
  
  
      @Override
      public void onCreate() {
          super.onCreate();
          Bugly.init(getApplication(), "344bc2d315", false);
          AVOSCloud.initialize(getApplication(), BuildConfig.APPLICATIONID, BuildConfig.CLIENTKEY);
          Realm.init(getApplication());
          PicassoHelper.buildPicasso(getApplication());
      }
  
  
      @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
      @Override
      public void onBaseContextAttached(Context base) {
          super.onBaseContextAttached(base);
          // you must install multiDex whatever tinker is installed!
          MultiDex.install(base);
  
          // 安装tinker
          // TinkerManager.installTinker(this); 替换成下面Bugly提供的方法
          Beta.installTinker(this);
      }
  
      @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
      public void registerActivityLifecycleCallback(Application.ActivityLifecycleCallbacks callbacks) {
          getApplication().registerActivityLifecycleCallbacks(callbacks);
      }
  
  }
  