Example usage for android.app FragmentTransaction setBreadCrumbTitle

List of usage examples for android.app FragmentTransaction setBreadCrumbTitle

Introduction

In this page you can find the example usage for android.app FragmentTransaction setBreadCrumbTitle.

Prototype

public abstract FragmentTransaction setBreadCrumbTitle(CharSequence text);

Source Link

Document

Like #setBreadCrumbTitle(int) but taking a raw string; this method is not recommended, as the string can not be changed later if the locale changes.

Usage

From source file:com.optimusinfo.elasticpath.cortex.common.EPFragmentActivity.java

protected void addFragment(String title, int fargmentContainerId, EPFragment objFragment) {
    mStackLevel++;//ww w . j  a v  a2s . co  m
    // Add the fragment to the activity, pushing this transaction
    // on to the back stack.
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.setBreadCrumbTitle(title);
    ft.add(fargmentContainerId, objFragment);
    ft.commit();
}

From source file:com.optimusinfo.elasticpath.cortex.common.EPFragmentActivity.java

/**
 * This method adds a fragment to the current activity
 * /*from   w  w  w.  ja v  a2 s .c  om*/
 * @param title
 * @param isNew
 * @param tag
 * @param fargmentContainerId
 * @param objFragment
 */
public void addFragmentToBreadCrumb(String title, int fargmentContainerId, EPFragment objFragment) {
    String breadTitle = title;
    if (title.length() > 16) {
        breadTitle = title.substring(0, 14).concat(getString(R.string.ellipsis));
    }
    mStackLevel++;
    // Add the fragment to the activity, pushing this transaction
    // on to the back stack.
    FragmentTransaction ft = getFragmentManager().beginTransaction();
    ft.setBreadCrumbTitle(breadTitle);
    ft.replace(fargmentContainerId, objFragment);
    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
    ft.addToBackStack(null);
    ft.commit();

}