188 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
138
views
runOnUIThread throwing error and crashing app
Well I am trying to create an app but it is giving me an error:
Accessibility content change on non-UI thread. Future Android versions will throw an exception.
My java code:
package com.tools.cpuusage;...
0
votes
1
answer
74
views
Changing Button Color on MainActivity via RunOnUIThread Crashes
I am getting a
kotlin.UninitializedPropertyAccessException: lateinit property BTNStatus05 has not been initialized
When I try to set a ButtonColor.
The idea is to change butttoncolor etc on a button, ...
0
votes
0
answers
65
views
Capture Images and show in RecyclerView : Too much work on the main thread
I am trying to capture images in my Android App using camera and show it in a list using RecyclerView
But because the images are quite heavy in size (6-7 MB each) and my list is can contains approx 8-...
0
votes
1
answer
67
views
Issue in rendering items in the main thread from a worker thread
I have created a counter app that counts from 0 to infinity until the loop is stopped using a stop button. The app contains 2 buttons(start and stop) and 1 textview.
I aim to display the values from 0 ...
1
vote
1
answer
280
views
Response error okhttp3. runOnUiThread/Thread
I want to make a request to the server and get a response from it. Next, display in displayWindow.
I can’t get a response from the server, I understand that I need to process the UI in a separate ...
2
votes
1
answer
98
views
runOnUIThread on android is unable to setfocus on the EditText and show soft keyboard
In my android application, the core logic is written in C++. Hence, for multiple scenarios, there will be JNI calls happening.
In one use-case, as the text is being entered by the user in the '...
1
vote
0
answers
92
views
Which Android API classes must have their methods runOnUiThread?
Despite Android being a multi-threaded, some API classes impose a strict requirement of having to only run on the UI thread.
For example,
All SpeechRecognizer's methods "must be invoked only ...
0
votes
2
answers
88
views
runOnUIThread for Android is hiding the soft keyboard
In my android application, the core logic is written in C++. Hence for multiple scenarios, there will be JNI calls happening.
In one use-case, as the text is being entered by the user in the 'EditText'...
0
votes
1
answer
272
views
Getting 'Unresolved reference' for 'runOnUiThread'
While trying to save an image I am getting the error message 'Unresolved reference:runOnUiThread' and also on the context terms inside the toast messages. The relevant code snippets are as below. I ...
4
votes
2
answers
4k
views
is there any difference between runOnUiThread and CoroutineScope(Dispatchers.Main) in Kotlin Android
I don't know is there any difference between CoroutineScope(Dispatchers.Main).launch and runOnUiThread, I think both will run on Main thread.
but still confusion is any difference there.?
Thanks.
0
votes
0
answers
89
views
android Dialog Dismiss -> Only the original thread that created a view hierarchy can touch its views. when I using runOnUiThread
I am dismiss Dialog through RunOnUiThread.
However, the error message is as follows.
"Only the original thread that created a view hierarchy can touch its views."
Can I know what to do?
This ...
0
votes
1
answer
4k
views
How to pass data that changes real-time from activity to fragment?
I am currently reading data from a Bluetooth Sensor, hence the data changes in real-time and continuously changes. I have stored the data in a variable: liveData:ByteArray
Now I am trying to send ...
0
votes
1
answer
140
views
nullPointerException on calling getActivity().runOnUiThread{new Runnable inside Fragment
i'm trying to update my ListPreference summary inside my PreferenceFragment with timer
while i'm inside my fragment everything is fine but as soon as i press the back button my app crashes and it ...
0
votes
0
answers
227
views
Function being called twice in runOnUiThread Android Studio java
I have a JavascriptInterface that calls a function to draw in a layout. This function needs to be run on the UI Thread. I don't know why, but it is always called twice, making my app fail. Can someone ...
1
vote
1
answer
36
views
Where are variables allocated when referenced within posted Runnables?
My understanding (though it could be incorrect!) is that in Method1(), myInt will be allocated on the stack and then deallocated upon returning from the method.
My question is about where myInt will ...