发布进度?

Jam*_* MV 1 java eclipse android

为什么这根据日食无效:

        protected String doInBackground(String... arg0) {

            publishProgress(10);  

            if(true){
                //validate with DB
            }else{
                //send to registration screen
            }

            return null;
        }

        //Update Progress       
        protected void onProgressUpdate(Integer... values) {

            mProgress.setProgress(values[0]);

        }
Run Code Online (Sandbox Code Playgroud)

Eclipse这样说:

publishProgress(10);  <<publishProgress(Void) is not acceptable for type publishProgress(Int)
Run Code Online (Sandbox Code Playgroud)

然而,这里的其他问题表明它以确切的方式使用.这是API的变化吗?我真的想传递一个字符串和int的publishProgress.这可能吗:

publishProgress("Starting Validation", 10);  
Run Code Online (Sandbox Code Playgroud)

TIA

Eng*_*uad 17

确保在通用参数中声明正确的类型,例如:

new AsyncTask()<Void, Integer, Void>{ ...
Run Code Online (Sandbox Code Playgroud)

AsyncTask<Params, Progress, Result>: