Java Code Examples for android.support.v4.app.FragmentActivity#getApplicationContext()

The following examples show how to use android.support.v4.app.FragmentActivity#getApplicationContext() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LogoutHelper.java    From social-app-android with Apache License 2.0 6 votes vote down vote up
public static void signOut(GoogleApiClient mGoogleApiClient, FragmentActivity fragmentActivity) {
    FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
    if (user != null) {
        ProfileInteractor.getInstance(fragmentActivity.getApplicationContext())
                .removeRegistrationToken(FirebaseInstanceId.getInstance().getToken(), user.getUid());

        for (UserInfo profile : user.getProviderData()) {
            String providerId = profile.getProviderId();
            logoutByProvider(providerId, mGoogleApiClient, fragmentActivity);
        }
        logoutFirebase(fragmentActivity.getApplicationContext());
    }

    if (clearImageCacheAsyncTask == null) {
        clearImageCacheAsyncTask = new ClearImageCacheAsyncTask(fragmentActivity.getApplicationContext());
        clearImageCacheAsyncTask.execute();
    }
}
 
Example 2
Source File: LogoutHelper.java    From social-app-android with Apache License 2.0 6 votes vote down vote up
public static void signOut(GoogleApiClient mGoogleApiClient, FragmentActivity fragmentActivity) {
    FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
    if (user != null) {
        ProfileInteractor.getInstance(fragmentActivity.getApplicationContext())
                .removeRegistrationToken(FirebaseInstanceId.getInstance().getToken(), user.getUid());

        for (UserInfo profile : user.getProviderData()) {
            String providerId = profile.getProviderId();
            logoutByProvider(providerId, mGoogleApiClient, fragmentActivity);
        }
        logoutFirebase(fragmentActivity.getApplicationContext());
    }

    if (clearImageCacheAsyncTask == null) {
        clearImageCacheAsyncTask = new ClearImageCacheAsyncTask(fragmentActivity.getApplicationContext());
        clearImageCacheAsyncTask.execute();
    }
}
 
Example 3
Source File: LoaderManagerCreator.java    From android-atleap with Apache License 2.0 5 votes vote down vote up
/**
 * Init Loader Manager for Activity
 * @param activity activity
 * @param callbacks callbacks
 * @param args arguments for loader construction
 * @param <T>
 */
public <T> LoaderManagerCreator(FragmentActivity activity, LoaderManager.LoaderCallbacks<T> callbacks, Bundle args) {
    this(
            activity.getApplicationContext(),
            activity.getSupportLoaderManager(),
            (int) HashUtil.longHash(((Object) activity).getClass(), activity.getIntent(), callbacks),
            callbacks,
            args
    );
}