Code example for AppWidgetHost

Methods: startListening

0
    } 
 
    @Override 
    public void onStart() { 
        super.onStart(); 
        mAppWidgetHost.startListening();
    } 
 
    @Override 
    public Object onRetainNonConfigurationInstance() {
        AppWidgetProviderInfo info = AppWidgetManager.getInstance(
                getBaseContext()).getAppWidgetInfo(mAppWidgetId);
        return info;
    } 
 
    private void startChooseActivity() { 
        int id = mAppWidgetHost.allocateAppWidgetId();
        Intent selectIntent = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
        selectIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, id);
        startActivityForResult(selectIntent, REQUEST_WIDGET);
Stop searching for code, let great code find you!  Add Codota to your java IDE