Android Multi-threading is the ability of an Android app to perform work concurrently or asynchronously by utilizing multiple concurrent streams of execution (generally referred to as threads).
Questions tagged [android-threading]
90 questions
0
votes
1 answer
Android studio: thread app not returning same value as non thread app
I'm working on an app that goes through all of the phone directories, and collecting all the songs.
When i run it normally it works fine, just takes about 6 seconds to go through everything, and causes the app to skip a lot of frames.
I changed it…

Yaels
- 13
- 3
0
votes
0 answers
Multiple threads being added to application every run through if the app is not shut down
Whilst running my android app the thread count is rising 20 threads per run through. I have google maps and display a map on the first activity then it is, choose destination run the route then finish and return to the map screen. the threads being…

user15348067
- 43
- 1
- 5
0
votes
1 answer
Accessing View of UI Thread from another Thread
I read that views created from UI thread can't be accessed from another thread directly without using post() method utilizing looper/Handler or RunonUI() method. This is for security reasons. I tried to test this and created a test class as below…

rajiv kumar
- 11
- 1
0
votes
0 answers
Error: Cannot invoke setValue on a background thread in Android Java
This issue does not include Livedata. I have read through several questions but have not found the answer to my issue the file below gives the error. simulatedUpdate() is called from a background Thread. The problem is with the call…

user15348067
- 43
- 1
- 5
0
votes
1 answer
Infrequent Handler.post's cause huge frame drops and crashes
I have a simple thread listening to UDP broadcasts to discover devices on my network. Whenever it receives a broadcast, it posts a Runnable to a Handler on the UI thread to add the device's IP to an ArrayList. At most, it receives packets once…

Martin_xs6
- 559
- 3
- 9
0
votes
1 answer
RxJava how to create an interval that has multiple jobs executed at different delay?
I am very new to RxJava so my question could be completely dumb, but I couldn't figure out how to do it.
So I have N jobs that implement the following interface
interface Worker {
int interval();
void job();
}
What I want to achieve is a…

Bako
- 313
- 1
- 15
0
votes
1 answer
How to use Two NotifyDataSetChanged() Atomically
To summarize my problem:
I have a list of items and a button that I click to query an API
When I click the button, two methods are called. The first method displays a progress bar, clears the list, and uses notifyDataSetChanged()
public void…

DIRTY DAVE
- 2,523
- 2
- 20
- 83
0
votes
0 answers
How much is too much work for the main thread to handle? Some questions regarding the threads in Android
I have a background in Java and recently, I'm learning about Java in Android so the question might seem to be overwhelming for a newcomer like me. Anyway, here are the questions (in italic).
I created a project using a template (Phone and Tablet -…

Hung Vu
- 443
- 3
- 15
0
votes
0 answers
How do I speed up my app when loading content from rest endpoints?
I made this app to pull information from various rest APIs. It's not done yet but so far, the data being loaded by the AsyncTask is too slow for my liking and sometimes skips 1000+ frames. Is there a way I could speed it up?
On a side note, I would…

Dayem Saeed
- 325
- 5
- 15
0
votes
0 answers
Problem with loading images in RecyclerView in onBindViewHolder
I a creating an app in which i am displaying an imageview and two texviews in a recycler view. I am trying to set image resource of the imageview from urls by using an imageloader i created.
ImageLoader class
public class ImageLoader {
private…

Pavan Santhosh
- 72
- 1
- 10
0
votes
0 answers
Generating Bitmaps for Google MapOverlays with Kotlin Coroutines
I'm having some issues building out a section of my code which edits server sent thumbnails and renders them as a Google GroundOverlay.
The issue seems to stem from Kotlin Coroutines. First, the documentation from Google says that the ground…

chrisdottel
- 1,053
- 1
- 12
- 21
0
votes
1 answer
Threading and parallelism in Android
I'm very new to Android development. Can anyone help me with this snippet, I don't know why it works perfectly although I'm updating my TextView from the worker thread.
When I say works perfectly, I mean the TextView shows the value count without…

Anil Joshi
- 1
- 1
0
votes
1 answer
Can't get output buffer from android camera
I'm working with Android Camera2 API and get this after getting a set of photos from camera on my smartphone with Android version 6.0 (API 23):
2020-04-09 20:36:58.556 260-9342/? E/Camera3-Stream: getBuffer: wait for output buffer return timed out…

Egor Richman
- 559
- 3
- 13
0
votes
1 answer
ProgressBar doesn't show, when using another thread
I turn circular indeterminate progressBar to visible and then I run Thread, that can take few seconds (I tried AsyncTask, but it didn't work, probably because there is another AsyncTask running inside the method). However, the progressBar gets…

Adam Knirsch
- 443
- 1
- 6
- 16
0
votes
1 answer
How to check if thread is alive after restarting an Activity?
I am running a heavy operation on a thread, which is invoked on button click. To prevent user from clicking that button again, I am simply checking if thread.isAlive(), which runs fine as long as I am in the current activity. When I press backpress…

ZigZag
- 53
- 6