0

i want to upgrade my app to run in android 5.0.1 but i encounter an error (The method execute(Object[]) is ambiguous for the type WebTask) message when i try to compile.

My code:

private final ArrayBlockingQueue<WebTask> queue = new ArrayBlockingQueue<WebTask>(
        1000);
private final List<WebTask> running = new ArrayList<WebTask>();

public synchronized void execute(final WebTask task) {
    queue.add(task);
    executeNext();
}

private synchronized void executeNext() {
    WebTask<? extends Object, ? extends Object, ? extends Object> task = null;
    while ((task = queue.peek()) != null) {
        if (canRun(task))
            queue.remove().execute(null); <----- error on execute
        else
            break;
    }
}

public void onClick(final DialogInterface dialog, final int which) {
                new WebTask(SettingsActivity.this, original, 
        newLocation).execute(null) <----- error on execute
                dialog.dismiss();
            }

Problem is that the extension (.zip, etc) of the downloaded file is missing, i need to rename it manually.

Can somebody please help? Thank you.

Bjorn
  • 135
  • 5
  • 12

1 Answers1

1

Leave it empty instead of passing null as parameter

 queue.remove().execute();
Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • Hi Blackbelt, thx for answering, it compiles ok now but the extension (.zip, etc) of the file is still missing. Any suggestions? – Bjorn Dec 20 '14 at 11:29