Im working on OpenGL tester program for Android. So i have pretty havy scene with 68 objects, each one has its own class. Im also have Activity, GLView and GLRenderer classes. All objects declared in GLRenderer like so:
private final lToe lToe = new lToe();
private final rToe rToe = new rToe();
private final pelvis pelvis = new pelvis();
private final waist waist = new waist();
private final chest chest = new chest();
My problem is – when i create GLView in Activity with lines:
showDialog(0);
GLView view;
view = new GLView(this);
setContentView(view);
my application stops responding for about 15 secs, it not showing my loading dialog(“showDialog(0);”), placed in dedicated thread, i even have “Not responding Stop/Wait” dialog every time i launching application. So is there some way to keep UI responding and progress bar showing properly, while loading ? (Sorry for bad english)
When you load the scene for the first time (create the view), you should do it on a separate thread, then call runOnUiThread() to pop up a dialog on the UI thread. I would also look at AsyncTask as it will save you time.