Code example for EditText

Methods: length

0
	private static View.OnClickListener buttonListener = new View.OnClickListener() {
 
		public void onClick(View v) { 
			switch (v.getId()) { 
			case DialogInterface.BUTTON1: 
				if (descriptionET.length() != 0 && subjectET.length() != 0 && emailET.length() != 0) { 
					toastHandler = new Handler() { 
						public void handleMessage(Message msg) { 
							super.handleMessage(msg); 
							// notify to user here 
							String message = msg.getData().getString("submit"); 
							if (message.equals("successfully")) 
								message = "Your request has successfully been submitted"; 
							else 
								message = "Your request couldn't be submitted, please try again"; 
							Toast.makeText(context, message, Toast.LENGTH_SHORT).show(); 
						} 
					}; 
					new Thread(runnable).start(); 
				} else { 
					if (descriptionET.length() == 0) 
						descriptionTV.setTextColor(Color.RED); 
					else 
						descriptionTV.setTextColor(Color.WHITE); 
					if (subjectET.length() == 0) 
						subjectTV.setTextColor(Color.RED); 
					else 
						subjectTV.setTextColor(Color.WHITE); 
					if (emailET.length() == 0) 
						emailTV.setTextColor(Color.RED);