I have a function which takes some time to execute. currently Im running it inside a Thread, because i cant make the AsyncTask working. i need to pass a double[] variable as input to doInBackground, then it should return the result which is also a double[] variable to onPostExecute where the result will be printed in a textView.
it looks this simple:
public class finder extends AsyncTask <Double , Void , Double> {
double[] input;
double[] result;
public finder() {
super();
}
@Override
protected double[] doInBackground(Double... params) {
result = foo(input)
return result;
}
protected void onPostExecute(Double... params) {
}
public double[] foo (double [] input){...}
}
so i have a few questions:
1- What configuration of arguments for the Class and each method could do the job?
2-Do i need to override the methods? (when i change the doInBackground specifier to double[] it gives me an error on @Override)
3- what should be each methods specifier?
4- how could i make onPostExecute recognize the textView? what shoud be passed to the asyncTask ?