I'm developing an android app in eclipse and this is what I'm calling in my main activity:

new PhotoUpdate(app).execute(Pair.create(PhotoUpdate.PARAM_FILE, photoPath));

My AsyncTask class Looks like this:

public class PhotoUpdate extends AsyncTask<Pair<String, String>, Void, String> {

    //some code

    @Override
    protected String doInBackground(Pair<String, String>...params) {

        //delegate functionality to some other methods
    }
}

However, In my activity I'm getting a compiler error where I call execute that says:

The method execute(Pair<String,String>...) in the type 
AsyncTask <Pair<String,String>,Void,String> is not applicable for the arguments 
(Pair<String,String>)

And these are the quick fixes it provides: enter image description here

Essentialy its complaining that I cant pass a pair of strings to a function that takes multiple pairs of string, this doesn't make sense. Has anybody else seen this error?

2

There are 2 best solutions below

0
On BEST ANSWER

Solved the Issue!

I am using a support Library in my project and the Pair Objects in the PhotoUpate Class and the Pair object I used to call execute were from different libraries (one was from support library on was from the android library).

0
On

'Pair...' this means you will have to send an array of 'pair', and you will get your data on doinbackground using params [0] you can use a constructor instead will be better.