Example usage for android.appwidget AppWidgetManager ACTION_APPWIDGET_PICK

List of usage examples for android.appwidget AppWidgetManager ACTION_APPWIDGET_PICK

Introduction

In this page you can find the example usage for android.appwidget AppWidgetManager ACTION_APPWIDGET_PICK.

Prototype

String ACTION_APPWIDGET_PICK

To view the source code for android.appwidget AppWidgetManager ACTION_APPWIDGET_PICK.

Click Source Link

Document

Activity action to launch from your AppWidgetHost activity when you want to pick an AppWidget to display.

Usage

From source file:com.launcher.silverfish.HomeScreenFragment.java

private void selectWidget() {

    // Allocate widget id and start widget selection activity
    int appWidgetId = this.mAppWidgetHost.allocateAppWidgetId();
    Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
    pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
    addEmptyData(pickIntent); // This is needed work around some weird bug.
    startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
}

From source file:com.launcher.silverfish.launcher.homescreen.HomeScreenFragment.java

public void popupSelectWidget() {
    // Allocate widget id and start widget selection activity
    int appWidgetId = this.mAppWidgetHost.allocateAppWidgetId();
    Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
    pickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
    addEmptyData(pickIntent); // This is needed work around some weird bug.
    startActivityForResult(pickIntent, REQUEST_PICK_APPWIDGET);
}

From source file:de.spiritcroc.modular_remote.MainActivity.java

public void addWidget(Container container) {
    addWidgetContainer = container;/*from   ww  w. j a  v  a 2  s. co m*/
    int appWidgetId = appWidgetHost.allocateAppWidgetId();
    Intent pickIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK)
            .putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
    startActivityForResult(pickIntent, MainActivity.REQUEST_PICK_APPWIDGET);
}