// Path: app/src/main/java/com/testerhome/nativeandroid/application/NativeApp.java
// public class NativeApp extends Application {
// 
//     public static RefWatcher getRefWatcher(Context context) {
//         NativeApp application = (NativeApp) context.getApplicationContext();
//         return application.refWatcher;
//     }
// 
//     private RefWatcher refWatcher;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         refWatcher = LeakCanary.install(this);
// 
//         // initialize fresco with OK HTTP
//         ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
//                 .newBuilder(this, new OkHttpClient())
//                 .build();
//         Fresco.initialize(this, config);
//     }
// }


import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import com.squareup.leakcanary.RefWatcher;
import com.testerhome.nativeandroid.R;
import com.testerhome.nativeandroid.application.NativeApp;
import butterknife.Bind;
import butterknife.ButterKnife;
package com.testerhome.nativeandroid.views.base;




/**
 * Created by vclub on 15/9/15.
 */
public class BaseActivity extends AppCompatActivity {

    @Nullable
    @Bind(R.id.toolbar)
    protected
    Toolbar toolbar;

    @Nullable
    @Bind(R.id.toolbar_title)
    TextView customTitle;

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ButterKnife.bind(this);

        setupToolbar();
    }

    protected void setupToolbar(){
        if (toolbar != null){
            setSupportActionBar(toolbar);
        }
    }

    public void setCustomTitle(String title){
        if (customTitle != null){
            customTitle.setText(title);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);

// Path: app/src/main/java/com/testerhome/nativeandroid/application/NativeApp.java
// public class NativeApp extends Application {
// 
//     public static RefWatcher getRefWatcher(Context context) {
//         NativeApp application = (NativeApp) context.getApplicationContext();
//         return application.refWatcher;
//     }
// 
//     private RefWatcher refWatcher;
// 
//     @Override public void onCreate() {
//         super.onCreate();
//         refWatcher = LeakCanary.install(this);
// 
//         // initialize fresco with OK HTTP
//         ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
//                 .newBuilder(this, new OkHttpClient())
//                 .build();
//         Fresco.initialize(this, config);
//     }
// }


// Path: app/src/main/java/com/testerhome/nativeandroid/views/base/BaseActivity.java
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import com.squareup.leakcanary.RefWatcher;
import com.testerhome.nativeandroid.R;
import com.testerhome.nativeandroid.application.NativeApp;
import butterknife.Bind;
import butterknife.ButterKnife;

package com.testerhome.nativeandroid.views.base;




/**
 * Created by vclub on 15/9/15.
 */
public class BaseActivity extends AppCompatActivity {

    @Nullable
    @Bind(R.id.toolbar)
    protected
    Toolbar toolbar;

    @Nullable
    @Bind(R.id.toolbar_title)
    TextView customTitle;

    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ButterKnife.bind(this);

        setupToolbar();
    }

    protected void setupToolbar(){
        if (toolbar != null){
            setSupportActionBar(toolbar);
        }
    }

    public void setCustomTitle(String title){
        if (customTitle != null){
            customTitle.setText(title);
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);

        RefWatcher refWatcher = NativeApp.getRefWatcher(this);