Example usage for android.appwidget AppWidgetHostView setFocusable

List of usage examples for android.appwidget AppWidgetHostView setFocusable

Introduction

In this page you can find the example usage for android.appwidget AppWidgetHostView setFocusable.

Prototype

public void setFocusable(boolean focusable) 

Source Link

Document

Set whether this view can receive the focus.

Usage

From source file:com.android.launcher3.Launcher.java

private void addAppWidgetToWorkspace(AppWidgetHostView hostView, LauncherAppWidgetInfo item,
        LauncherAppWidgetProviderInfo appWidgetInfo, boolean insert) {
    hostView.setTag(item);/*w  w  w .j a v a2  s  .com*/
    item.onBindAppWidget(this, hostView);

    hostView.setFocusable(true);
    hostView.setOnFocusChangeListener(mFocusHandler);

    mWorkspace.addInScreen(hostView, item.container, item.screenId, item.cellX, item.cellY, item.spanX,
            item.spanY, insert);

    if (!item.isCustomWidget()) {
        addWidgetToAutoAdvanceIfNeeded(hostView, appWidgetInfo);
    }
}