@Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    Log.d(TAG, "************************ Creating and seting view");
    mOpenCvCameraView = (CameraBridgeViewBase) new JavaCameraView(this, -1);
    setContentView(mOpenCvCameraView);
    mOpenCvCameraView.setCvCameraViewListener(this);
    mPuzzle15 = new PuzzleProcessor(Settings.getGridSize(this));
    mPuzzle15.prepareNewGame();
  }
 @Override
 public boolean onOptionsItemSelected(MenuItem item) {
   Log.i(TAG, "Menu Item selected " + item);
   if (item == mItemStartNewGame) {
     /* We need to start new game */
     mPuzzle15 = new PuzzleProcessor(Settings.getGridSize(this));
     mPuzzle15.prepareGameSize(mGameWidth, mGameHeight);
     mPuzzle15.prepareNewGame();
   } else if (item == mItemHideNumbers) {
     /* We need to enable or disable drawing of the tile numbers */
     mPuzzle15.toggleTileNumbers();
   } else if (item == mItemSettings) {
     final Intent i = new Intent(this, SettingsActivity.class);
     startActivity(i);
   }
   return true;
 }