29 Aug 2012, 01:25
Generic-user-small

William O (7 posts)

I am trying to open a dialog to say congratulations when the game is finished. I have tried to follow other posts to do this but am running into problems. In the game class I have created a method isSolved
@ /*Check to see if the game is complete*/ public boolean isSolved() { for (int element : puzzle) { if (element 0) return false; } return true; }@
And in the puzzle view I have added an if statement at the top of thr onKeyDown method to see if there is any moves left.
@public boolean onKeyDown(int keyCode, KeyEvent event) {

if (game.isSolved() true)
 {
     Intent i = new Intent(PuzzleView.this, Congratulations.class); 
      startActivity(i); 
 }
 else
 {
Log.d(TAG, "onKeyDown: keycode=" + keyCode + ", event=" 
      + event);
switch (keyCode) {....... more code follows@
This is the error I am getting.
The constructor Intent(PuzzleView, Class) is undefined
  You must be logged in to comment