Code example for Stack

Methods: removeAllElements

0
			public void onClick(View v) {
				input.delete(0, input.length());
				showInput.delete(0, showInput.length());
				inputText.setText(showInput.toString());
				results1Text.setText("0");
				stack.removeAllElements();
			} 
		}); 
		 
		delete.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				//Deleting from stack can be tricky 
				//Issue is when something has been evaluated already and then is asked 
				//to be deleted 
				if(showInput.length() > 0) {
					if(showInput.charAt(showInput.length()-1) == ' ') {
						showInput.delete(showInput.length()-3, showInput.length());
					} 
					else { 
						showInput.deleteCharAt(showInput.length()-1);
					}