publishProgress from inside a function in doInBackground?
<p>I use an AsyncTask to perform a long process.</p>

<p>I don't want to place my long process code directly inside doInBackground. Instaid my long process code is located in another class that I call in doInBackground.</p>

<p>I would like to be able to call publishProgress from inside the longProcess function.
In C++ I would pass a callback pointer to publishProgress to my longProcess function. </p>

<p>How do I do that in java ?</p>

<p>EDIT: </p>

<p>My long process code:</p>

<pre><code>public class MyLongProcessClass
    {
    public static void mylongProcess(File filetoRead)
        {
        // some code...
        // here I would like to call publishProgress
        // some code...
        }
    }
</code></pre>

<p>My AsyncTaskcode:</p>

<pre><code>private class ReadFileTask extends AsyncTask&lt;File, Void, Boolean&gt;
    {
    ProgressDialog  taskProgress;

    @Override
    protected Boolean doInBackground(File... configFile)
        {
        MyLongProcessClass.mylongProcess(configFile[0]);
        return true;
        }
    }
</code></pre>

<p>EDIT #2
The long process methode could also be non-static and called like this:</p>

<pre><code>MyLongProcessClass fileReader = new MyLongProcessClass();
fileReader.mylongProcess(configFile[0]);
</code></pre>

<p>But that does not change my problem.</p>
