Blank field, java causing app crash
<p>When the field is left blank it makes the app crash. How can i stop it ?</p>

<pre><code>EditText editText = (EditText)findViewById(R.id.editText);
userNumber = Integer.parseInt(editText.getText().toString());
</code></pre>

<p>I tried giving it a .setError("Don't leave this blank!"), but it doesn't seem to do the thing, the app crashes there.</p>

<p>Screenshots:<br>
     <a href="https://i.stack.imgur.com/z9Ckqm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JwQXKl.png" alt="screen-shot"></a>
<a href="https://i.stack.imgur.com/z9Ckqm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z9Ckqm.png" alt="error-message"></a></p>