12-04 09:23:04.524: W/System.err(7535): java.lang.SecurityException: Neither user 10106 nor current process has android.permission.MODIFY_PHONE_STATE.
 请高手指点谢谢.  最好有demo  ! 

解决方案 »

  1.   

    app没有权限android.permission.MODIFY_PHONE_STATE.
      

  2.   

    private void answerCall() {
    TelephonyManager telMag = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    Class<TelephonyManager> c = TelephonyManager.class;
    Method mthCall = null;
    try {
    mthCall = c.getDeclaredMethod("getITelephony", (Class[]) null);
    mthEndCall.setAccessible(true);
    ITelephony iTel = (ITelephony) mthCall.invoke(telMag,
    (Object[]) null);
    iTel.answerRingingCall();
    this.finish();
    } catch (Exception e) {
    System.out.println(e.toString());
    e.printStackTrace();
    e.printStackTrace();
    }
    }
      

  3.   

    private void answerCall() {
    TelephonyManager telMag = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
    Class<TelephonyManager> c = TelephonyManager.class;
    Method mthCall = null;
    try {
    mthCall = c.getDeclaredMethod("getITelephony", (Class[]) null);
    mthCall.setAccessible(true);
    ITelephony iTel = (ITelephony) mthCall.invoke(telMag,
    (Object[]) null);
    iTel.answerRingingCall();
    this.finish();
    } catch (Exception e) {
    System.out.println(e.toString());
    e.printStackTrace();
    e.printStackTrace();
    }
    }