Search in sources :

Example 1 with FacebookDelegate

use of org.michenux.yourappidea.facebook.FacebookDelegate in project YourAppIdea by Michenux.

the class YourAppMainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ((YourApplication) getApplication()).inject(this);
    setContentView(R.layout.main);
    // toolbar
    Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolBar);
    // For debug
    if (BuildConfig.DEBUG) {
        Log.d(YourApplication.LOG_TAG, "HashKey: " + SecurityUtils.logHashKey(this));
    }
    // app usage
    AppUsageUtils.updateLastUsedTimestamp(this);
    // init fragment
    if (savedInstanceState == null) {
        this.navController.goHomeFragment(this);
        this.navController.showWhatsNew(this);
    }
    // ads
    mAdView = (AdView) findViewById(R.id.adView);
    AdRequest adRequest = new AdRequest.Builder().addTestDevice(AdRequest.DEVICE_ID_EMULATOR).addTestDevice("1174B15820BDCDE357023377AAF1D72D").addTestDevice("FB73634EFAFEF29BE7973A97B5543A4D").addTestDevice(//LG Nexus 5
    "3C4438D5DE2E7086B63C92FC5846F662").build();
    mAdView.loadAd(adRequest);
    // social networks
    mFacebookDelegate = new FacebookDelegate(mUserHelper, this);
    mFacebookDelegate.setUserSessionCallback(this);
    mGoogleAuthDelegate = new GoogleAuthDelegate(this, mUserHelper);
    mGoogleAuthDelegate.setUserSessionCallback(this);
}
Also used : YourApplication(org.michenux.yourappidea.YourApplication) AdRequest(com.google.android.gms.ads.AdRequest) FacebookDelegate(org.michenux.yourappidea.facebook.FacebookDelegate) GoogleAuthDelegate(org.michenux.drodrolib.gms.auth.GoogleAuthDelegate) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 AdRequest (com.google.android.gms.ads.AdRequest)1 GoogleAuthDelegate (org.michenux.drodrolib.gms.auth.GoogleAuthDelegate)1 YourApplication (org.michenux.yourappidea.YourApplication)1 FacebookDelegate (org.michenux.yourappidea.facebook.FacebookDelegate)1