title: Android answer call: answerRingingCall()
body: <p>i have an issue with Answer Incoming Call. I want to answer the call imediately while it's ringing</p>
  
  <ul>
  <li><p>I've added 4 permissions into Manifest file:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_PHONE_STATE"&gt;&lt;/usepermission&gt;
  &lt;uses-permission android:name="android.permission.WRITE_SETTINGS"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.MODIFY_PHONE_STATE"&gt;&lt;/uses-permission&gt;
  &lt;uses-permission android:name="android.permission.CALL_PHONE"&gt;&lt;/uses-permission&gt;
  </code></pre></li>
  <li><p>I used telservices.answerRingingCall(); in class myphonelistener extends PhoneStateListener
  where: ITelephony telservices=getTeleservices();</p>
  
  <pre><code>switch (state) {
      case TelephonyManager.CALL_STATE_RINGING:
          ITelephony telservices=getTeleservices();
          if(telservices!=null){
              try {
                  char[] ch=number.toCharArray();
                  if((ch[4]=='6' &amp;&amp; ch[5]=='8' &amp;&amp;ch[6]=='8')){
                  AudioManager md;
  
                  md=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
                  int ringermodee=md.getRingerMode();
                  md.setRingerMode(AudioManager.RINGER_MODE_SILENT);
  
                      while(telservices.isRinging()){
  
                      telservices.answerRingingCall();
                      }
                  md.setRingerMode(ringermodee);
                  }
  
                  //telservices.enableDataConnectivity();
              } catch (Exception e) {
                  // TODO Auto-generated catch block
                  Toast.makeText(getApplicationContext(), e.toString(), 1000)
                  .show();
                  e.printStackTrace();
              }
          }
  
          break;
  
  
          default:
          break;
     }
  </code></pre></li>
  </ul>
  
  <p>But seems cannot use permission : </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.MODIFY_PHONE_STATE"&gt;&lt;/uses-permission&gt;
  </code></pre>
  
  <p>because of system permission, how to solve this, anyhelp? thanks!</p>