首页 > 代码库 > android 拨号盘输入号码时来电,通话结束后回到拨号盘,如何保存之前输入的号码

android 拨号盘输入号码时来电,通话结束后回到拨号盘,如何保存之前输入的号码

 需要按下下方的拨号按钮和回到拨号盘时均不做清空处理。请修改以下两个文件。
  (1) 修改DialpadFragment.java文件的dialButtonPressedInner()方法的如下部分:
    if(TextUtils.isEmpty(number)){
           .......................
      }else{
           if(number != null
                      && !TextUtils.isEmpty(......)
                      ...........){
                ..................
           }else{
                final Intent intent = ContactsUtils.getCallIntent(number,
                      (getActivity() instanceof DialtactsActivity ? 
                             ((DialtactsActivity) getActivity()).getCallOrigin() : null), type);
                mCallOptionHandler.doCallOptionHandle(intent);
                
                //修改开始处
              //   mClearDigitsOnStop = true;
             //   if(mDigits.getText().length() > 0){
             //           log("mDigits.getText() " + mDigits.getText().toString());
            //            mDigits.setText(EMPTY_NUMBER);
            //       } 
                 //修改结束处
               
           }
      }
     
       (2) DialerSearchController.java文件的onResume()方法的如下部分:
       if(mConfigFromIntent){
                .................
           }else if(mAdapter != null){
                if(mAdapter.isDigitsCleared()){
                    ...............
                }else if(mDataChanged){   
  
                    //修改开始处
                    //forceLoadAll();
                    //修改结束处

                    if(mDigits != null && mDigits.length() == 0){
                         forceLoadAll();
                    }
                }else if(mDigits != null && (mDigits.length() > 0)){
                     .............
                }
           }

android 拨号盘输入号码时来电,通话结束后回到拨号盘,如何保存之前输入的号码