Breadcrumb is one of the most important UX term in Web development as well as in Android App development. Breadcrumbs is a control element used as a navigational aid in User Interface in Application or in a website. It allows users to keep track of their locations within Application or websites. 

Here we going to discuss Breadcrumbs with several methods, interface, classes as well with one example.

Class for Breadcrumb in Android

There is Predefine class in Android for Breadcrumb is “FragmentBreadCrumbs”


Public Methods for FragmentBreadCrumbs

Some of the methods are followed:-

1. onBackStackChanged

void onBackStackChanged ()

Called whenever the contents of the back stack change.

2. setActivity

void setActivity (Activity a)

Attach the bread crumbs to their activity. This must be called once when creating the bread crumbs.

3. setMaxVisible

void setMaxVisible (int visibleCrumbs)

The maximum number of breadcrumbs to show. Older fragment headers will be hidden from view.

4. setOnBreadCrumbClickListener

void setOnBreadCrumbClickListener (FragmentBreadCrumbs.OnBreadCrumbClickListener listener)

Sets a listener for clicks on the bread crumbs. This will be called before the default click action is performed.

5. setParentTitle

void setParentTitle (CharSequence title,
CharSequence shortTitle,
View.OnClickListener listener)
Inserts an optional parent entry at the first position in the breadcrumbs. Selecting this entry will result in a call to the specified listener’s onClick(View) method.

6. setTitle

added in API level 11
void setTitle (CharSequence title,
CharSequence shortTitle)
Set a custom title for the bread crumbs. This will be the first entry shown at the left, representing the root of the bread crumbs. If the title is null, it will not be shown.

There is only Interface for this class is :-


Let undersatand BreadCrumbs with an example:-

protected void onCreate(Bundle savedInstanceState) {

    mFragmentManager = getSupportFragmentManager();

    mFragmentBreadCrumbs = (FragmentBreadCrumbs) findViewById(;

    mMapFragment = (MapFragment) mFragmentManager.findFragmentByTag("map");
    if (mMapFragment == null) {
        mMapFragment = new MapFragment();

                .add(, mMapFragment, "map")

    findViewById( View.OnClickListener() {
        public void onClick(View view) {



Hope this image will clear all your Quries about Breadcrumb.



Categories: AndroidUX


Android Developer Intern


kumars knk · October 13, 2017 at 8:18 AM

Ohh, great to share this information thanks..
I am really happy to say it’s an interesting post to read . I learn new information from your article
Online Marketing in Hyderabad

Leave a Reply