Questions tagged as 'asynctask'

1
answer

Task in await Task.WhenAll New transaction is not allowed because there are other threads running in the session

I'm doing a program Console , where basically it executes these 4 procedures Retrieves a IEnumerable<_Url> Parse these urls Inserts into Database Mark this _Url, as read (processed) so it does not process anymore...
asked by 10.10.2016 / 19:24
0
answers

Proccess Dialog does not open AsyncTask

During an API interaction that lasts an average of 5 seconds, I need to put a Process Dialog. My code: public class finalizaPedido extends AsyncTask<Object, Void, Integer> { private String retorno; private String url; pri...
asked by 04.06.2016 / 16:53
2
answers

How to get the return of the method ofInBackground in android?

I'm starting to work with AsyncTasks and I still do not know much. I created a class that extends AsyncTask and implemented the doInBackground() method, but my question now is how do I get the return of this method? In another class in th...
asked by 15.07.2017 / 00:51
1
answer

How to add AsyncTask to this task?

Hello, could anyone help me add an AsyncTask to this task? Here I am connecting to a JSON for information, then it will be added to RecyclerView. RequestQueue queue = Volley.newRequestQueue(this); String shhik = "http://meusite/arquivo...
asked by 05.10.2016 / 21:36
1
answer

execute Task.When all wait and then go back run

I'm trying to do a console program, run a task, wait and run again and continue on this cycle infinitely. In theory would be to put the function inside an infinite While(true) loop, but as the function is asynchronous it is not working...
asked by 20.10.2016 / 22:10
1
answer

AsyncTask - Does not run twice

I am performing a process in my App, where in the MainActivity, I press a button, so it loads a JSON into another Activity that brings all the information correctly. However, when I close the screen and try to view the data listing again, it dis...
asked by 03.01.2018 / 00:52
2
answers

Cancel AsyncTask when choosing another menu item with Navigation Drawer

The Problem I'm developing an app that has a side navigation menu ( Navigation Drawer ) as shown in the figure below. Uploading some items from this menu requires an Internet request. Here everything works perfectly. When the m...
asked by 04.09.2015 / 13:15
1
answer

AsyncTask Android generating NullPointerException

I have this static class in an Activity where its function and download a file and save it on the user's device. I tested it on a real device in Android version 7.1.1 and 4.1.2 and it worked correctly. However, by launching the application I hav...
asked by 04.05.2018 / 23:16
1
answer

Notify the current Activity that background function has finished running Android

I have a class that looks for a list of clients in the background with a AsyncTask . It can be called from any Activity , and returns nothing, just fetches the list of clients that comes in json and saves that list as stri...
asked by 11.07.2016 / 17:02
1
answer

Problem with SQLite in the onPostExecute method of AsyncTask

I'm having a problem running an SQLite function in the onPostExecute method of AsyncTask. When implementing the same function in the Activity it executes normally, but onPostExecute does not even enter the breakpoint I put in the function. Th...
asked by 06.04.2016 / 16:03