title: required field validation on android
body: <p>In android how do I create a required field validation? like on a page where use can enter some data into some <code>EditText</code>. I wanted to make sure user enter something before continuing, like if the user forgot to enter some data, the app would not crash. I have done other validation like number only using those input-type provided. but so far I research I only found ways to validate content entered but not whether there is something entered. 
  So I should put something in the <code>onCreate</code> method like </p>
  
  <pre><code>if(EditText text is !=null){ do the stuff} else {error message}
  </code></pre>
  
  <p>But if I did that, the moment the app is run there will be error displayed. 
  And how do I write the "text of EditText" in c# I believe is <code>TextBox</code> Text. But I do not know how to do that in java android. I know setText but do not know how to refer to the content without changing it.</p>