NoClassDefFoundError becase of OnLayoutChangeListener?
<p>I have a problem with understanding the following events, please help.</p>

<p>I have an application with a menu Activity. In the menu there is a button, that when pressed starts a timer, that when finished tells the menu Activity that it has fininshed. It does that by using an interface I have made. The Activity recives the callback from the button and starts a new Activity via an Intent. The new Activity contains several views and one of them being an AdView. This used to run just fine before, but...</p>

<p>Now I have made some changes to the layout and I need to know when the AdView changes its size. To do this I added an OnLayoutChangeListener to the AdView, and here's the problem. When the new Activity containing the AdView starts I recive a NoClassDefFoundError regarding the Activity class I tried to create.</p>

<p>I have also noticed that the error happens even if I actually don't add the listener to the AdView, it seems to occur only because the Activity implements OnLayoutChangeListener.</p>

<p>If it is any help, the Activity also implements Runnable and OnClickListener, and also uses multiple Threads. Now, I don't know why any of that would be important, but there it is.</p>

<p>And just for the record, I have both restarted Eclipse and cleaned the project.
Please help anyone, I realy don't understand this.</p>

<p><strong>Edit</strong></p>

<p>Starts the Game activity:</p>

<pre><code>public void onSlideEnd(View v) {
    if (v == game){
        Intent i = new Intent();
        i.setClass(this, Game.class);
        startActivity(i);

        finish();
    }
}
</code></pre>

<p>OnCreate method of the Game activity:</p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.layout_game);
    setRequestedOrientation(1);
    setVolumeControlStream(AudioManager.STREAM_MUSIC);

    layoutBase = (LinearLayout) findViewById(R.id.layoutBase);
    Drawable d = getResources().getDrawable(R.drawable.wood);
    layoutBase.setBackgroundDrawable(d);

    adView = (AdView) findViewById(R.id.adViewGame);
    adView.addOnLayoutChangeListener(this);

    layoutTop = (LinearLayout) findViewById(R.id.layoutTop);

    brickBox = new BrickBox(this);
    layoutBrick = (LinearLayout) findViewById(R.id.layoutBox);
    layoutBrick.addView(brickBox);
    brickBox.addOnLayoutChangeListener(this);

    goal = new GoalBox(this);
    LinearLayout layoutGoal = (LinearLayout) findViewById(R.id.layoutGoal);
    layoutGoal.addView(goal);
    goal.addOnLayoutChangeListener(this);

    restart = (Button) findViewById(R.id.buttonRestart);
    restart.setOnClickListener(this);

    start = (Button) findViewById(R.id.buttonStart);
    start.setOnClickListener(this);

    menu = (Button) findViewById(R.id.buttonMenu);
    menu.setOnClickListener(this);

    TextView time = (TextView) findViewById(R.id.textViewTime);
    TextView click = (TextView) findViewById(R.id.textViewClick);
    scoreBoard = new ScoreBoard(this, time, click);

    soundManager = new SoundManager(this);

    resizeLayouts();
}
</code></pre>

<p>Crash code:</p>

<pre><code>01-01 13:27:05.537: E/AndroidRuntime(3781): FATAL EXCEPTION: Thread-9
01-01 13:27:05.537: E/AndroidRuntime(3781): java.lang.NoClassDefFoundError: com.martin.colorPuzzleFree.Game
01-01 13:27:05.537: E/AndroidRuntime(3781):     at com.martin.colorPuzzleFree.Menu.onSlideEnd(Menu.java:65)
01-01 13:27:05.537: E/AndroidRuntime(3781):     at com.martin.colorPuzzleFree.BrickButton.allertListenersEnd(BrickButton.java:258)
01-01 13:27:05.537: E/AndroidRuntime(3781):     at com.martin.colorPuzzleFree.BrickButton.run(BrickButton.java:243)
01-01 13:27:05.537: E/AndroidRuntime(3781):     at java.lang.Thread.run(Thread.java:1102)
</code></pre>

<p>I also noticed that this is shown in the Log upon application start:</p>

<pre><code>01-01 13:27:03.247: W/dalvikvm(3781): Link of class 'Lcom/martin/colorPuzzleFree/Game;' failed
01-01 13:27:03.257: E/dalvikvm(3781): Could not find class 'com.martin.colorPuzzleFree.Game', referenced from method com.martin.colorPuzzleFree.Menu.onSlideEnd
01-01 13:27:03.267: W/dalvikvm(3781): VFY: unable to resolve const-class 162 (Lcom/martin/colorPuzzleFree/Game;) in Lcom/martin/colorPuzzleFree/Menu;
</code></pre>
