All Questions
Tagged with android android-asynctask
14,127
questions
0
votes
0
answers
16
views
Android Thread InputStream from web page
I have an old app in Android that just downloads the content of a web page and sends it to a Bluetooth printer. It was working fine but with the new Google restrictions to Android apps it's just ...
0
votes
1
answer
27
views
How to associate Fragment with no UI to the MainActivity
I have MainActivity.java that implements an interface from SshFragment.java which runs an AsyncTask in the fragment. The fragment has no UI but I'm unsure how to define it so and I'm confused how to ...
0
votes
1
answer
26
views
android.os.NetworkOnMainThreadException even using an Aysnc task
I am trying to call a SOAP service with Android studio, but I am getting the following exception android.os.NetworkOnMainThreadException
I know should be when running a network call on the main thread,...
0
votes
0
answers
37
views
accessing MainActivity from long running async task safe way (eg after conguration change)
I have a long running (really long, more than 60 seconds or more) async task. Sometimes this task has to access the MainActivity (mostly UI updates, but sometimes accessing Shared Preferences and ...
0
votes
0
answers
25
views
Java Android how to make two parallel progress bars in recyclerview
I am making a game that has a recyclerview with several items, each item has its own progressbar filling time, I need them to fill in parallel and start over after completion.
I did it with asynctask. ...
-2
votes
2
answers
54
views
How to wait for async task to finish getting data from database before loading maps without sleep?
So my object is simple and need to know if I can either make my code better all the way around or remove sleep from my code and somehow wait for the async task to finish with getting data from a ...
0
votes
0
answers
84
views
How to overcome ANRs issue even though i run the background task in GlobalScope.launch(Dispatchers.Main)
The app is prompted with an "App is not responding" window.
In my main activity, inside the button click, I am calling "Background task" Meanwhile I am shown a progress bar in the ...
0
votes
1
answer
59
views
Writing Values to Google Sheet - Coroutines and NetworkOnMainThreadException Issue
I'm attempting to write data from a list to a specific Google Sheet. I've set up the configuration, but I'm encountering an error that seems related to not using a coroutine.
Is my approach correct? ...
0
votes
0
answers
33
views
Socket closes after sending a message, thus making receiving message impossible
I have a server handler class in my android app that reads and write messages in the Socket, the socket gets passed to it by the ClientController which runs this socket in AsyncTask. connection to the ...
0
votes
1
answer
36
views
Change value in a TextView after requests to firebase - Java Android studio
I make two requests to the Firebase database, and then load the data into the XML. But it doesn't load them and just leaves the default, I suspect it's because I'm not handling asynchronous requests ...
0
votes
1
answer
48
views
Change TextView in the xml file after two asynchronous requests - Java Android studio
I make two requests to the Firebase database, and then load the data into the XML. But it doesn't load them and just leaves the default, I suspect it's because I'm not handling asynchronous requests ...
0
votes
0
answers
38
views
ANR Genrated : Local Database data load is not working properly in android
I have one query regarding the local database.
As my system works, when the user logs in for the first time in the application that time in the dashboard we get an API call for getting data. But in ...
0
votes
0
answers
28
views
First call to Glide load is slower
I have an app which loads images in a recyclerview. In order for it to be smooth, images are loaded using Glide. What I have noted is that the first call to Glide, for example
Glide.with(ctx).load(R....
0
votes
1
answer
161
views
AsyncTask onBackground() throws error - Caused by: java.lang.IllegalStateException: Method addObserver must be called on the main thread
Today I opened my project which haven't been updated for about 6 months now and I decided to update all the libraries to make it up to date with recent Android development environment.
After updating ...
0
votes
0
answers
41
views
onPostExcute executed before doInbackground in asynctask
i have asynctask which i call api inside doInBackGround and i'm using okhtpp and then i enqueue the request actually the enqueue does not block the main thread so the asyncTask execute onPostExcute() ...