自动获取短信验证码并填充以及倒计时

public class MainActivity extends Activity {
 
     private EditText mEditText;
     private Button mSendButton, mNextButton;
     private TextView mTextView;
     private TimeCount mTiemTimeCount;
     //填写服务器号码
     private static final String SERVICECHECKNUM = "" ;
     
     //计时重发
     private class TimeCount extends CountDownTimer {
          
         public TimeCount( long millisInFuture, long countDownInterval) {
             super (millisInFuture, countDownInterval);
         }
  
         @Override
         public void onTick( long millisUntilFinished) {
             mSendButton.setClickable( false );
             mSendButton.setText(millisUntilFinished / 1000 + "秒后重新发送" );
         }
  
         @Override
         public void onFinish() {
             mSendButton.setText( "获取验证码" );
             mSendButton.setClickable( true );
         }
     }
     
     //短信验证码内容 验证码是6位数字的格式
     private String strContent;
     private String patternCoder = "(?

你可能感兴趣的:(Android)