Example usage for android.app Activity getBaseContext

List of usage examples for android.app Activity getBaseContext

Introduction

In this page you can find the example usage for android.app Activity getBaseContext.

Prototype

public Context getBaseContext() 

Source Link

Usage

From source file:com.yangtsaosoftware.pebblemessenger.activities.ToolsFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    ((NavigationActivity) activity).onSectionAttached(positionIndex);
    _context = activity.getBaseContext();

}

From source file:com.murati.oszk.audiobook.ui.PlaybackControlsFragment.java

private void onMetadataChanged(MediaMetadataCompat metadata) {
    LogHelper.d(TAG, "onMetadataChanged ", metadata);
    if (getActivity() == null) {
        LogHelper.w(TAG, "onMetadataChanged called when getActivity null,"
                + "this should not happen if the callback was properly unregistered. Ignoring.");
        return;/*  w w w  .  j av a2s  . c  o  m*/
    }
    if (metadata == null) {
        return;
    }

    mTitle.setText(metadata.getDescription().getTitle());
    mSubtitle.setText(metadata.getDescription().getSubtitle());
    String artUrl = null;
    if (metadata.getDescription().getIconUri() != null) {
        artUrl = metadata.getDescription().getIconUri().toString();
    }

    Activity activity = getActivity();
    GlideApp.with(activity).load(artUrl).override(Target.SIZE_ORIGINAL)
            .fallback(ContextCompat.getDrawable(activity.getBaseContext(), R.drawable.ic_navigate_books))
            .into(mAlbumArt);
}

From source file:com.charbgr.BlurNavigationDrawer.v7.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int openDrawerContentDescRes,
        int closeDrawerContentDescRes) {
    super(activity, drawerLayout, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();
    this.mDrawerLayout = drawerLayout;
    init();//  ww w.  ja  v  a  2  s  . co  m
}

From source file:com.charbgr.BlurNavigationDrawer.v7.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, Toolbar toolbar,
        int openDrawerContentDescRes, int closeDrawerContentDescRes) {
    super(activity, drawerLayout, toolbar, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();
    this.mDrawerLayout = drawerLayout;
    init();// w w  w .  jav a 2s .  co m
}

From source file:com.charbgr.BlurNavigationDrawer.v4.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes,
        int openDrawerContentDescRes, int closeDrawerContentDescRes) {
    super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();
    this.mDrawerLayout = drawerLayout;
    init();//  w  ww  . j av  a 2  s.  c  o  m
}

From source file:com.sismics.bluractionbar.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes,
        int openDrawerContentDescRes, int closeDrawerContentDescRes) {
    super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();

}

From source file:com.sismics.bluractionbar.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes,
        int openDrawerContentDescRes, int closeDrawerContentDescRes, View layout) {
    super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();
    init(layout, mBlurRadius);/*from w  w w  .  j a v  a 2 s. co m*/
}

From source file:com.sismics.bluractionbar.BlurActionBarDrawerToggle.java

public BlurActionBarDrawerToggle(Activity activity, DrawerLayout drawerLayout, int drawerImageRes,
        int openDrawerContentDescRes, int closeDrawerContentDescRes, View layout, int radius) {
    super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes, closeDrawerContentDescRes);
    this.context = activity.getBaseContext();
    init(layout, radius);/*from www  . ja v  a 2  s.  c om*/
}

From source file:org.dmfs.tasks.SettingsListFragment.java

@Override
public void onAttach(Activity activity) {
    super.onAttach(activity);
    mSources = Sources.getInstance(activity);
    mContext = activity.getBaseContext();
    mAuthority = getActivity().getString(R.string.org_dmfs_tasks_authority);
}

From source file:paulscode.android.mupen64plusae.persistent.UserPrefs.java

public void enforceLocale(Activity activity) {
    Configuration config = activity.getBaseContext().getResources().getConfiguration();
    if (!mLocale.equals(config.locale)) {
        config.locale = mLocale;//from  www  . ja v a  2 s  .  c o  m
        activity.getBaseContext().getResources().updateConfiguration(config, null);
    }
}