Code example for AppWidgetHost

0
    		widgetIds[0] = -1;
    	} 
        mContext = c;
        hostViews = new AppWidgetHostView[widgetIds.length];
        mAppWidgetManager = AppWidgetManager.getInstance(c);
        mAppWidgetHost = new AppWidgetHost(c, 2112);
    } 
 
    @Override 
    public int getCount() { 
        return widgetIds.length;
    } 
 
    public int getHeight(int pos) {
        int height = getSavedHeight(pos);
        if (height == -1) {
            if (hostViews[pos] != null && hostViews[pos].getAppWidgetInfo() != null) {
                height = hostViews[pos].getAppWidgetInfo().minHeight;
            } else { 
                height = 100;  // default size
            }