title: Add PhoneStateListener
body: <p>I'm trying to set up <code>PhoneStateListener</code> but I get a <code>PhoneCallListener cannot be resolved to a type</code>.</p>
  
  <pre><code>public class ButtonView extends FrameLayout  {
  
       PhoneCallListener phoneListener = new PhoneCallListener();
       TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
       telephonyManager.listen(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
  }
  </code></pre>
  
  <p>In another Example, I found its written like this and it's working</p>
  
  <pre><code>public class MainActivity extends Activity {
      public void onCreate(Bundle savedInstanceState) {
  
          // add PhoneStateListener
          PhoneCallListener phoneListener = new PhoneCallListener();
          TelephonyManager telephonyManager = (TelephonyManager) this
              .getSystemService(Context.TELEPHONY_SERVICE);
          telephonyManager.listen(phoneListener,PhoneStateListener.LISTEN_CALL_STATE);
  }
  </code></pre>
  
  <p>What should I change in my code to make it working?</p>