Example usage for android.widget Toolbar getChildCount

List of usage examples for android.widget Toolbar getChildCount

Introduction

In this page you can find the example usage for android.widget Toolbar getChildCount.

Prototype

public int getChildCount() 

Source Link

Document

Returns the number of children in the group.

Usage

From source file:Main.java

private static TextView getTitleTextView(Toolbar toolbar) {
    TextView textView = null;//ww  w  .j  a v  a 2s  .co  m
    for (int i = 0; i < toolbar.getChildCount(); i++) {
        if (toolbar.getChildAt(i).getClass() == TextView.class) {
            textView = (TextView) toolbar.getChildAt(i);
        }
    }
    return textView;
}