Code example for MenuItem

Methods: getTitle

0
	} 
	 
	// Finish the current ListActivity when the Exit button is selected 
	@Override 
	public boolean onOptionsItemSelected(MenuItem menuitem){
		if(menuitem.getTitle().equals("Exit")){
			finish();
		} 
		return true; 
	} 
	 
	// Build and show an AletDialog 
	public void call_alert_dialog(String title, String message){
		AlertDialog.Builder builder=new AlertDialog.Builder(this);
		 
		builder
			.setTitle(title)
			.setMessage(message)
			.setPositiveButton(R.string.dialog_close_button, new close_button_listener())
			.show(); 
	}