Back to project page template-android.
The source code is released under:
MIT License
If you think the Android project template-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.org.application; /*w ww .ja v a 2s .c o m*/ import android.app.Application; import android.content.Context; import com.org.application.util.Log; import dagger.ObjectGraph; /** * */ public class App extends Application { private static final String TAG = App.class.getSimpleName(); private ObjectGraph objectGraph; @Override public void onCreate() { super.onCreate(); if(BuildConfig.DEBUG){ Log.sLogEnabled = true; Log.sLogLevel = 0; //Print all the logs! } buildObjectGraphAndInject(); } public void buildObjectGraphAndInject() { objectGraph = ObjectGraph.create(Modules.list()); objectGraph.inject(this); } public void inject(Object o) { objectGraph.inject(o); } public static App get(Context context){ return (App)context.getApplicationContext(); } }