Example usage for android.view ViewGroup hasFocus

List of usage examples for android.view ViewGroup hasFocus

Introduction

In this page you can find the example usage for android.view ViewGroup hasFocus.

Prototype

@Override
public boolean hasFocus() 

Source Link

Document

Returns true if this view has or contains focus

Usage

From source file:android.support.v7.app.ToolbarActionBar.java

@Override
public boolean requestFocus() {
    final ViewGroup viewGroup = mDecorToolbar.getViewGroup();
    if (viewGroup != null && !viewGroup.hasFocus()) {
        viewGroup.requestFocus();/*from   w  w w .j  ava 2s . c  om*/
        return true;
    }
    return false;
}