14,472 questions
1 vote
0 answers
56 views
How to add cards to a fragment on network response in Android
I am new to Android and looking for some help. I am making a get request which returns a list as a string. For each entry in this list I want to add a card to a linearLayout in a horizontal scrollview ...
0 votes
1 answer
40 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
49 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
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
126 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 ...
1 vote
0 answers
185 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
93 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
1 answer
48 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
56 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
50 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
1 answer
374 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
126 views
Passing or declaring variable of AsyncExecutorService in right way
Since Android 11 AsyncTask is deprecated so I implemented in a separate .java file this AsyncExecutorService abstract class: public abstract class AsyncTaskExecutorService<Params, Progress, Result&...
0 votes
1 answer
103 views
Why is my JSON Volley request causing ANR if it is Asynchronous in itself and the data transfer into my database is handled within an AsyncTask?(JAVA)
Just an FYI, this is my first time working with JSON, Volley, or ASyncTask. For a coding challenge I have to download a JSON array from a url into an android application and display the list of items ...
0 votes
1 answer
97 views
AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
I am making an app for showing nearby places. But I have a runtime error FATAL EXCEPTION: AsyncTask #2NullPointerException and the app is crashed. I am trying to send nearby places data URL. But I ...
-1 votes
1 answer
700 views
Hi; how can i interrupt an async function during its allotted runtime?
We are coding behaviors for a robot in python async; we would like the robot to have multiple states, within each of which it will exhibit multiple behaviors, some random, some in order. These ...