Code example for AppWidgetHost

Methods: stopListening

0
    } 
     
    @Override 
    protected void onStop() { 
    	super.onStop(); 
    	host.stopListening();	//stop to listen widget related broadcast event.
    } 
     
	public void onCreateContextMenu (ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo){
		super.onCreateContextMenu(menu, v, menuInfo);
		Log.i("Q",Integer.toString(v.getId()));
		menu.add(0,1,0,"À§Á¬ Ãß°¡");
		menu.add(0,2,0,"»ùÇÃ 2");
		menu.add(0,3,0,"»ùÇÃ 3");
	} 
	public boolean onContextItemSelected (MenuItem item){
		switch (item.getItemId())	{
		case 1: 
        	Intent i = new Intent(AppWidgetManager.ACTION_APPWIDGET_PICK);
        	int a = host.allocateAppWidgetId();
Connect your IDE to all the code out there  Get Codota for Java