Android dynamic UI update from AsynchTask/Handler and Thread priorities
There must be another issue with your code. Try posting your AsyncTask in here. You could also try something very basic like: Create a new Thread that loops every 25Hz and update your UI by using the post() method of your UI elements or the runInUiThread() of your Activity. See if there's any code still running inside the UI Thread, that could do heavy work, that can be done outside the UI Thread.
I tried literally everything except for the most logic thing, trying the application without the debugger connected. The reason to have slower simulation than in a PC, to freese UI events... all because the debugger takes a lot of resources from the device. So, I guess that from this point and avobe I will have to test the application without debugger, what forces me to reboot the phone each time to avoid the "waiting for debugger to connect". Thank to all who tried.
I could be wrong, but I think that yours problem in synchronization on simulator.getSimulationResults() object. I can't see the realization of the simulator class and realization of the object returned by getSimulationResults(), but I suppose that getSimulationResults() returns the same object every time? If so, then it can be looks like this: In the AsyncTaks call simulator.getSimulationResults().updateSimulation(...). If this method is synchronized, then this call will be lock the SimulationResults object for AsyncTaks thread. updateSimulation(...) returns, and publishProgress() is called, but publishProgress() is only schedule the onProgressUpdate(Void... values) in the UI thread. The new iteration in the AsyncTaks thread can be started befor the UI thread gets the control and executes onProgressUpdate(Void... values). So, AsyncTaks thread goes to the first step. The UI thread gets the control and executes the onProgressUpdate(Void... values) and synchronized void updateHUD() methods, but updateHUD() can't be executed, because SimulationResults object is locked by the AsyncTaks thread in the updateSimulation(...) method. So the UI thread returns the control to the OS. This may occur many times. So, onProgressUpdate(Void... values) method and all events in the UI thread can be executed only if the UI thread gets the control in the right moment when updateSimulation(...) method is not called in the AsyncTask thread. You can check this idea by replacing the public synchronized void update HUD() on the public void update HUD(), and write something randomly in the TextView. In any case, the use of AsyncTask in this case is not the best idea. AsyncTask's are executed in the TheadPool, but in the Android system this pool can consist from only one thread. So, all AsyncTask's will be executed one by one in the one thread.
java.lang.IllegalArgumentException: Given String is empty or null when executing Firebase updatePassword() Method
Running LXC on Android
Why is onNext not getting called when using toList?
How to set alarmManager for a specified time
GoogleApiAvailability missed with firebase-messaging:9.4.0
Getting a Floating Action button between two layouts which already has elevation
Clear all List in spinner items
Vector icon not show on Lollipop and above
Is it possible to change theme in each intent in Android Studio?
Sharing text post on Facebook Wall from my application using Facebook Sdk Android
Unable to publish my apk as beta in my ionic application
canvas draw not smooth circles
Spotify for Android claims audiofocus inappropriately
getText() return empty string in Edittext android
assets folder missing in LibGDX project
Setting multiple style items to the same value in xml