Code example for AppWidgetHost

Methods: startListening

 * Re-listen when widgets are reset. 
private void onAppWidgetReset() { 
private void undoLastWidget() { 
	widgCount--;//the incremented value was waiting for next add, peel it back to remove last
	Log.v("delete request", "trying to remove " + widgCount);
	RelativeLayout parent= (RelativeLayout) findViewById(;
	//deduct its width from the count 
	int w = mAppWidgetManager.getAppWidgetInfo(widgetId[widgCount]).minWidth;
	if (mRowWidth == w && currentRow != 0) {
Connect your IDE to all the code out there  Get Codota for Java