title: Android - How to check if textview is null or not null
body: <p>I have some textview in my application
  and want to check whether the properties of text on my textview has a value or null.
  then i want to display a toast if the value on my textview null</p>
  
  <p>but the toast is not running as it should</p>
  
  <p>this is my code :</p>
  
  <pre><code>public class brekeleV2 extends Activity {
  static Context context;
  brekeleV2Model r = new brekeleV2Model();
  private EditText jalan, kota, postal;
  
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  
      context = getApplicationContext();
      Button go = (Button)findViewById(R.id.go);
      go.setOnClickListener(onGo);
  
      Button reset = (Button)findViewById(R.id.reset);
      reset.setOnClickListener(onRes);
      jalan =(EditText)findViewById(R.id.jalan);
      kota =(EditText)findViewById(R.id.kota);
      postal =(EditText)findViewById(R.id.post);
      jalan.setText(null);
      kota.setText(null);
      postal.setText(null);
  }
  </code></pre>
  
  <p>and this is the onClick method code:</p>
  
  <pre><code>private View.OnClickListener onGo=new View.OnClickListener() {
  
      public void onClick(View v) {
          if (jalan.getText()!= null &amp;&amp; kota.getText()!=null){
              switch(v.getId()){
                  case R.id.go:
                      Intent maps = new Intent();
                      maps.setClassName("com.openit.brekele", "com.openit.brekele.brekeleV2Nav");
                      brekeleV2Nav.putLatLong(lat, lon);
                      startActivity(maps);
                      break;
  
              }
          }else{
              Toast msg = Toast.makeText(brekeleV2.this, "Lengkapi Data", Toast.LENGTH_LONG);
              msg.setGravity(Gravity.CENTER, msg.getXOffset() / 2, msg.getYOffset() / 2);
              msg.show();
          }
  </code></pre>