Java Code Examples for android.support.v7.app.ActionBarActivity#getSupportActionBar()

The following examples show how to use android.support.v7.app.ActionBarActivity#getSupportActionBar() . 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: BaseDrawerFragment.java    From android-atleap with Apache License 2.0 5 votes vote down vote up
protected ActionBar getActionBar() {
    ActionBarActivity activity = (ActionBarActivity)getActivity();
    if (activity != null)
        return activity.getSupportActionBar();
    else
        return null;
}
 
Example 2
Source File: VaultsListFragment.java    From secrecy with Apache License 2.0 5 votes vote down vote up
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
    if (!EventBus.getDefault().isRegistered(this)) {
        EventBus.getDefault().register(this);
    }
    context = (ActionBarActivity) getActivity();
    if (context == null) {
        return;
    }
    VaultHolder.getInstance().clear();

    if (context.getSupportActionBar() != null) {
        context.getSupportActionBar().setTitle(R.string.App__name);
    }
    if (!Util.canWrite(Storage.getRoot())) {
        Util.alert(CustomApp.context,
                CustomApp.context.getString(R.string.Error__root_IOException),
                CustomApp.context.getString(R.string.Error__root_IOException_message),
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        mFinishListener.onNew(null, new SettingsFragment());
                    }
                },
                null
        );
        return;
    }
    imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);
}
 
Example 3
Source File: AbstractTabsAdapter.java    From tup.dota2recipe with Apache License 2.0 5 votes vote down vote up
public AbstractTabsAdapter(ActionBarActivity activity, ViewPager pager) {
    super(activity.getSupportFragmentManager());
    mContext = activity;
    mActionBar = activity.getSupportActionBar();
    mViewPager = pager;
    mViewPager.setAdapter(this);
    mViewPager.setOnPageChangeListener(this);
}