I have this code :
private void submitPstart() {
if (tStock.getText().charAt(0)>=\'A\' && tStock.getText().charAt(0)<=\'Z\'){
}else
Try
if (tStockPIStart.getText().length() > 0 && tStockPIStart.getText().charAt(0)>='A' && tStockPIStart.getText().charAt(0)<='Z')
In your case, if the text is empty, then the length returned will be 0. Hence the charAt(..) method will throw you an exception. As such, you should first check that the text that you're trying to compare is empty or not.