Android Open Source - Fruity-Bang Loading Async Task






From Project

Back to project page Fruity-Bang.

License

The source code is released under:

MIT License

If you think the Android project Fruity-Bang listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package vn.edu.rmit.fruitybang;
/*from  w  ww .  ja v a 2  s .  c om*/
import Game.Game;
import android.app.Dialog;
import android.os.AsyncTask;
import android.util.Log;

public class LoadingAsyncTask extends AsyncTask<Void, Void, Void> {
  private Dialog dialog;
  private Game game;

  public LoadingAsyncTask(Dialog dialog, Game game) {
    this.dialog = dialog;
    this.game = game;
  }

  @Override
  public Void doInBackground(Void... params) {
    try {
      while (!game.isFinished()) {
        Thread.sleep(3000);
        Log.i("Fruity", "Thread sleep for 3 second");
      }
      Thread.sleep(5000);
    } catch (Exception e) {
      Log.i("Fruity", "Catched Exception " + e.toString());
    } finally {
      dialog.dismiss();
    }
    return null;
  }
}




Java Source Code List

GameController.BushGhost.java
GameController.CharGhost.java
GameController.SaGhost.java
GameController.WormGhost.java
Game.GameConstant.java
Game.Game.java
Game.Home.java
Game.MapGenerator.java
GameModel.Bush.java
GameModel.Coin.java
GameModel.CuteModel.java
GameModel.Explosion.java
GameModel.Fruit.java
GameModel.Rock.java
GameModel.Ruby.java
GameModel.Sa.java
GameModel.Win.java
GameModel.Worm.java
Game.Scene.java
Game.Store.java
Model.Account.java
vn.edu.rmit.fruitybang.GameActivity.java
vn.edu.rmit.fruitybang.LoadingAsyncTask.java
vn.edu.rmit.fruitybang.MainActivity.java
vn.edu.rmit.fruitybang.SelectionFragment.java
vn.edu.rmit.fruitybang.SplashFragment.java