Search in sources :

Example 1 with MyLogImp

use of tinker.sample.android.Log.MyLogImp in project tinker by Tencent.

the class SampleApplicationLike method onBaseContextAttached.

/**
     * install multiDex before install tinker
     * so we don't need to put the tinker lib classes in the main dex
     *
     * @param base
     */
@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);
    SampleApplicationContext.application = getApplication();
    SampleApplicationContext.context = getApplication();
    TinkerManager.setTinkerApplicationLike(this);
    TinkerManager.initFastCrashProtect();
    //should set before tinker is installed
    TinkerManager.setUpgradeRetryEnable(true);
    //optional set logIml, or you can use default debug log
    TinkerInstaller.setLogIml(new MyLogImp());
    //installTinker after load multiDex
    //or you can put com.tencent.tinker.** to main dex
    TinkerManager.installTinker(this);
    Tinker tinker = Tinker.with(getApplication());
}
Also used : MyLogImp(tinker.sample.android.Log.MyLogImp) Tinker(com.tencent.tinker.lib.tinker.Tinker) TargetApi(android.annotation.TargetApi)

Aggregations

TargetApi (android.annotation.TargetApi)1 Tinker (com.tencent.tinker.lib.tinker.Tinker)1 MyLogImp (tinker.sample.android.Log.MyLogImp)1