/** Appelé à la première création de l'activité */ @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.lib_game); // récupération des éléments de l'activité gameView = (GameView) findViewById(R.id.game_view); infoText = (TextView) findViewById(R.id.info_turn); buttonNext = (Button) findViewById(R.id.next_turn); buttonQuit = (Button) findViewById(R.id.b_quit); // config et mise en place des listener sur les éléments gameView.setFocusable(true); gameView.setFocusableInTouchMode(true); gameView.setCellListener(new CellListener()); buttonNext.setOnClickListener(new NextButtonListener()); buttonQuit.setVisibility(View.INVISIBLE); buttonQuit.setOnClickListener(new QuitButtonListener()); game = new TttGame(); }
/** Called when the activity is first created. Inititializes all the graphical views. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); thisActivity = this; mRobotType = this.getIntent().getIntExtra(SplashMenu.MINDDROID_ROBOT_TYPE, R.id.robot_type_shooterbot); setUpByType(); requestWindowFeature(Window.FEATURE_NO_TITLE); StartSound mySound = new StartSound(this); mySound.start(); // setup our view, give it focus and display. mView = new GameView(getApplicationContext(), this); mView.setFocusable(true); setContentView(mView); reusableToast = Toast.makeText(this, "", Toast.LENGTH_SHORT); // experimental TTS support for the lejosMINDdroid project mTts = new TextToSpeech( this, this // TextToSpeech.OnInitListener ); }