Example usage for android.app ActionBar setTitle

List of usage examples for android.app ActionBar setTitle

Introduction

In this page you can find the example usage for android.app ActionBar setTitle.

Prototype

public abstract void setTitle(@StringRes int resId);

Source Link

Document

Set the action bar's title.

Usage

From source file:com.app.blockydemo.ui.fragment.AddBrickFragment.java

private void setUpActionBar() {
    ActionBar actionBar = getActivity().getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);
    previousActionBarTitle = actionBar.getTitle();
    actionBar.setTitle(this.getArguments().getString(BUNDLE_ARGUMENTS_SELECTED_CATEGORY));
}

From source file:com.app.blockydemo.ui.fragment.BrickCategoryFragment.java

private void setUpActionBar() {
    ActionBar actionBar = getActivity().getActionBar();
    actionBar.setDisplayShowTitleEnabled(true);

    this.previousActionBarTitle = actionBar.getTitle();
    actionBar.setTitle(R.string.categories);
}

From source file:ar.uba.fi.mileem.SimpleFormActivity.java

protected void setTitle() {
    SpannableString s = new SpannableString(getString(R.string.app_name));
    s.setSpan(new TypefaceSpan(this, "Roboto-Light.ttf"), 0, s.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
    // Update the action bar title with the TypefaceSpan instance
    ActionBar actionBar = getActionBar();
    actionBar.setTitle(s);
}

From source file:com.learnit.LearnIt.activities.EditWord.java

private void removeActionBarLabelIfNeeded() {
    ActionBar actionBar = this.getActionBar();
    if (actionBar == null) {
        return;/*  ww  w  . j  a v  a  2 s  .  c  o m*/
    }
    actionBar.setTitle("");
}

From source file:fr.android.scaron.diaspdroid.vues.fragment.ParamsFragment.java

@AfterViews
void updateBarIcon() {
    DiasporaConfig.addActivity(getActivity());
    String methodName = ".updateBarIcon : ";
    LOG.d(methodName + "Entre");
    LOG.d(methodName + "getActionBar");
    ActionBar actionBar = getActivity().getActionBar();
    if (actionBar != null) {
        LOG.d(methodName + "actionBar.setTitle");
        actionBar.setTitle("Paramtres");
    }//from  w ww .j ava2s  .  co  m
    LOG.d(methodName + "Entre");
}

From source file:com.codebutler.farebot.activity.AdvancedCardInfoActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_advanced_card_info);

    findViewById(R.id.error_button).setOnClickListener(new View.OnClickListener() {
        @Override//from  ww w  .  ja  v a 2  s  . com
        public void onClick(View v) {
            reportError();
        }
    });

    Serializer serializer = FareBotApplication.getInstance().getSerializer();
    mCard = Card.fromXml(serializer, getIntent().getStringExtra(AdvancedCardInfoActivity.EXTRA_CARD));

    ViewPager viewPager = (ViewPager) findViewById(R.id.pager);
    mTabsAdapter = new TabPagerAdapter(this, viewPager);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setTitle(mCard.getCardType().toString() + " " + Utils.getHexString(mCard.getTagId(), "<error>"));

    if (mCard.getScannedAt().getTime() > 0) {
        String date = Utils.dateFormat(mCard.getScannedAt());
        String time = Utils.timeFormat(mCard.getScannedAt());
        actionBar.setSubtitle(Utils.localizeString(R.string.scanned_at_format, time, date));
    }

    if (getIntent().hasExtra(EXTRA_ERROR)) {
        mError = (Exception) getIntent().getSerializableExtra(EXTRA_ERROR);
        if (mError instanceof UnsupportedCardException) {
            findViewById(R.id.unknown_card).setVisibility(View.VISIBLE);
        } else if (mError instanceof UnauthorizedException) {
            findViewById(R.id.unauthorized_card).setVisibility(View.VISIBLE);
            findViewById(R.id.load_keys).setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    startActivity(new Intent(AdvancedCardInfoActivity.this, AddKeyActivity.class));
                }
            });
        } else {
            findViewById(R.id.error).setVisibility(View.VISIBLE);
            ((TextView) findViewById(R.id.error_text)).setText(Utils.getErrorMessage(mError));
        }
    }

    CardHasManufacturingInfo infoAnnotation = mCard.getClass().getAnnotation(CardHasManufacturingInfo.class);
    if (infoAnnotation == null || infoAnnotation.value()) {
        mTabsAdapter.addTab(actionBar.newTab().setText(R.string.hw_detail), CardHWDetailFragment.class,
                getIntent().getExtras());
    }

    CardRawDataFragmentClass annotation = mCard.getClass().getAnnotation(CardRawDataFragmentClass.class);
    if (annotation != null) {
        Class rawDataFragmentClass = annotation.value();
        if (rawDataFragmentClass != null) {
            mTabsAdapter.addTab(actionBar.newTab().setText(R.string.data), rawDataFragmentClass,
                    getIntent().getExtras());
            actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
        }
    }
}

From source file:android.hawkencompanionapp.fragments.BaseFragment.java

@Override
public void onCreate(Bundle savedInstance) {
    super.onCreate(savedInstance);
    final Bundle bundle = getArguments();
    final ActionBar actionBar = getActivity().getActionBar();

    if (bundle != null) {
        final String fragmentTitle = bundle.getString(UserAccountMainActivity.FRAGMENT_TITLE_BUNDLE_KEY);
        if (fragmentTitle != null) {
            actionBar.setTitle(fragmentTitle);
        }//ww w.  j a v  a  2  s.  c  om
    }
}

From source file:com.bdenney.locl.fragment.NearbyFragment.java

private void setActionBarTitle(final String title) {
    ActionBar actionBar = getActivity().getActionBar();
    if (actionBar != null) {
        actionBar.setTitle(title);
    }// ww  w . j a va 2  s  .  c o  m
}

From source file:org.catnut.fragment.TransientUsersFragment.java

@Override
public void onStart() {
    super.onStart();
    ActionBar bar = getActivity().getActionBar();
    bar.setIcon(R.drawable.ic_title_people);
    bar.setTitle(getString(mFollowing ? R.string.his_followings : R.string.his_followers, mScreenName));
}

From source file:it.polimi.spf.app.MainActivity.java

public void restoreActionBar() {
    ActionBar actionBar = getActionBar();
    //actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
    actionBar.setDisplayShowTitleEnabled(true);
    actionBar.setTitle(mTitle);
}