I'm writing an App for VFR navigation. The App uses OSMDroid (currently version 6.1.8). Basically the App works, but sometimes (can't say under which conditions!) the App "freezes".
Using log files, I can see, the App works, but the whole display is frozen...
The functions that draw the elements were called, all App's functions works and no exception can be found in the log files.
But the display just stop working (not only the OSMDroid's Map will not be updated, but other elements, too). I can restart the App, other Apps works, but my App doesn't.
The App will not respond to user interaction (tapping on buttons or similar) and all elements on the screen will not be refreshed.
Trying to force a elements' refresh does not give any results...
I wrote a Thread that refreshes the screen every 500ms, so that the rest of the App should work "alone".
My code:
contentView = findViewById(android.R.id.content).getRootView();
updateThread = new Thread(new Runnable()
{
@Override
public void run()
{
while(1)
{
MainActivity.this.runOnUiThread(new Runnable() {
public void run() {
try
{
periodicalScreenUpdate(); // this will update the elements on screen...
Logger.debug("Invalidate screen");
contentView.invalidate();
}
catch(Exception e)
{
Logger.notice(e);
}
}
}
Thread.sleep(500);
}
});
}
Does someone have any idea what can be the problem and how I can solve it?
EDITED: I cannot reproduce the problem with the emulator, but this is not a problem of the device, since I have the problem on all my devices (different types!)...
Thank you very very much!
Luca