You are on page 1of 1

private void showDialog() { progressDialog1 = new ProgressDialog(this); progressDialog1.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL ); progressDialog1.setMessage("Loading...Please Wait"); progressDialog1.setCanceledOnTouchOutside(false); progressDialog1.setCancelable(false); progressDialog1.setProgress(0); progressDialog1.setMax(100); progressDialog1.

show(); new Thread(new Runnable() { @Override public void run() { while(progressDialog1.getProgress() < progressDi alog1.getMax() && isRunning) { try { System.gc(); System.runFinalization(); //leverContinue.releaseBitmap(); Log.d("isRunning "+isRunning, "r un"); System.gc(); progressDialog1.setMessage("Load ing...Please Wait"); progressDialog1.incrementProgres sBy(2); Thread.sleep(30); if(progressDialog1.getProgress()== p rogressDialog1.getMax()) { progressDialog1.cancel() ; if(isRunning) { finish(); Intent i = new I ntent(StartGame.this, LeverContinue.class); startActivity(i) ; } } } catch(Exception ex) {} } } }).start(); }

You might also like