예제 #1
0
  @Override
  protected void onStop() {
    super.onStop();

    SomUtil.close();

    if (gameView != null) {
      gameView.stopThread();
      gameView.unregisterListener();
    }

    finish();
  }
예제 #2
0
 @Override
 public boolean onMenuItemSelected(int featureId, MenuItem item) {
   super.onMenuItemSelected(featureId, item);
   switch (item.getItemId()) {
     case 0:
       if (gameView.state == GameManager.PAUSE) {
         gameView.resume();
       } else {
         gameView.pause();
       }
       break;
     case 1:
       gameView.restartLevel();
       break;
   }
   return true;
 }
예제 #3
0
  @Override
  protected void onDestroy() {
    super.onDestroy();

    if (gameView != null) {
      gameView.unregisterListener();
    }

    SomUtil.close();

    //		gameView.stopThread();

  }
예제 #4
0
  protected void onResume() {
    super.onResume();
    if (gameView != null) {
      // registra no init()
      // gameView.registerListener();
    }

    if (gameView.state == GameManager.PAUSE) {
      gameView.resume();
    }

    SomUtil.resume();
  }
예제 #5
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    JogoTarta.logFree("0 - JogoTarta Activity : " + (Runtime.getRuntime().freeMemory() / 1024));

    initPreferences();

    setContentView(R.layout.tarta);

    gameView = (GameManager) findViewById(R.id.gameview);
    gameView.setJogoTarta(this);

    admobs();

    // gameView = new GameManager(this);
    // setContentView(gameView);
  }