Code example for PopupMenu

Methods: setOnMenuItemClickListener, show

0
				@Override 
				public void onClick(View v) {
					// TODO Auto-generated method stub 
					 
					 
				    popup.show();   
					 
				    popup.setOnMenuItemClickListener(new OnMenuItemClickListener() {  
						 
						@Override 
						public boolean onMenuItemClick(MenuItem item) {
							// TODO Auto-generated method stub 
							 
							SharedPreferences.Editor editor=sharedPreference.edit();
							if(!item.isCheckable())
							{ 
								item.setCheckable(true);
								item.setChecked(true);							
							} 
							 
							switch(item.getItemId())