title: Call intent in Android
body: <p>How can I make <code>call</code> by pressing button? I get my number as a string from <code>EditText</code>. Here is my sample code:</p>
  
  <pre><code>String phone = editPhone.getText().toString();
  btnPhone.setOnClickListener(new View.OnClickListener() {
  
              @Override
              public void onClick(View arg0) {
  
                  call();
              }
          });
  public void call() {
      try {
          Intent callIntent = new Intent(Intent.ACTION_CALL);
          callIntent.setData(Uri.parse(phone));
          startActivity(callIntent);
      } catch (ActivityNotFoundException activityException) {
           Log.e("myphone dialer", "Call failed", e);
      }
  }
  </code></pre>
  
  <p>I added all <code>permissions</code> to manifest file.</p>
  
  <p>but I am getting <code>NullPointerexception</code></p>