title: Disable button click : only when field is empty
body: <p><strong>this Question is different because this is using api data to intent and then if you use normal if else condition its not working . check the right answer below and the condition of it</strong> ----------</p>
  
  <p>hi,
  I'm trying to get android call service to a button click ,button is inside a <code>ListView</code> when I click one list item it goes to single item view in that single item view each single item has a mobile number attached to call button . Numbers are stored in parse data base and i'm calling using parse api . </p>
  
  <p>Now when I'm clicking a number it goes to call function . what I need is, suppose a single view doesn't have a mobile number , the button should not be clickable.If anyone knows please help me.</p>
  
  <blockquote>
    <p>edited answer as one of below anwer but this also not working</p>
  </blockquote>
  
  <pre><code>btn = (Button) findViewById(R.id.button56) ;
                  btn.setClickable(false);
  
                  btn.setOnClickListener(new View.OnClickListener() {
  
                      @Override
                      public void onClick(View v) {
  
  
                          String phno = object.getString("telephone");
                          Intent i=new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" +phno));
                          startActivity(i);
                      }
                  });
  </code></pre>
  
  <p>Below is my code</p>
  
  <pre><code>btn = (Button) findViewById(R.id.button56) ;
              btn.setOnClickListener(new View.OnClickListener() {
                  @Override
                  public void onClick(View v) {
  
  
                      String phno = object.getString("telephone");
                      Intent i=new Intent(Intent.ACTION_DIAL,Uri.parse("tel:" +phno));
                      startActivity(i);
                  }
              });
  </code></pre>