Since I need to get String array from the Asyntask, I need to use the get() after the execute():
String[] result = task.execute().get();
But I also want a loading circle while the task is running and the ProgressDialog only works if you don't use the get() method. This is confirmed, I've done some tests. So I think the only option left here is to call the ProgressDiaglog from the MainActivity. But unluckily it doesn't work. Any solution?