2017-11-10 4 views
-1

私はprogressdialogを行った後にインテントを追加したい、私はすでにインテントを追加していますが、動作していないので、コンパイル時にエラーが発生します。ProgressDialog内にIntentを追加するには?

ます。private void showProgressDialog(){

progressDialog = new ProgressDialog(this); 
    progressDialog.setMessage("Validating"); 
    progressDialog.show(); 
    progressDialog.setCancelable(false); 

    new CountDownTimer(28000, 1000) { 

     public void onTick(long millisUntilFinished) { 
      int[] countTimer = new int[] {.......}; 
      String[] setMessage = new String[]{......}; 
      count=count+1; 
      for(int i=0; i<countTimer.length; i++) { 
       if (count == countTimer[i]){ 
        progressDialog.setMessage(setMessage[i]); 
       } 
      } 
     } 

     public void onFinish() { 
      //the progress is finish 
      count=0; 
      progressDialog.dismiss(); 
      Intent i = new Intent(this, Main2Activity.class); 
      startActivity(i); 
     } 

    }.start(); 
} 

私は

Error:(66, 28) error: no suitable constructor found for Intent(<anonymous CountDownTimer>,Class<Main2Activity>)constructor Intent.Intent(String,Uri) is not applicable(argument mismatch; 

答えて

1

このエラーを取得するあなたのthisは、ほんの少しの正しい、感謝

+0

同様のYourActivity.thisか気にいらを使用しようと、CountDownTimerを指し、その仕事 – nicvaldy

関連する問題