Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7000191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:38:22+00:00 2026-05-27T20:38:22+00:00

I have a problem with understanding the following events, please help. I have an

  • 0

I have a problem with understanding the following events, please help.

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…

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.

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.

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.

And just for the record, I have both restarted Eclipse and cleaned the project.
Please help anyone, I realy don’t understand this.

Edit

Starts the Game activity:

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

        finish();
    }
}

OnCreate method of the Game activity:

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();
}

Crash 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)

I also noticed that this is shown in the Log upon application start:

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;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:38:22+00:00Added an answer on May 27, 2026 at 8:38 pm

    I have found the answer myself. It was quite obvious actually, the phone I am testing on is running Android 2.2, but OnLayoutChangeListener was not implemented until Android 3.0. Eclipse didn’t see the problem because the AdView requires the app to target Android 3.2, which included OnLayoutChangeListener, but when the Activity was started on my phone it didn’t know what to do with the interface and crashed. I tested the app on an emulator running Android 3.2 and it worked.

    Conclusion, check your version!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following basic (and maybe stupid) understanding problem in JSF: There is
Please assist with MVVM design/understanding problem. Given that we have a Windows Phone app
I have an understanding problem of how the following code works: XMLInputFactory xif =
There are many skills a programmer could have (understanding the problem, asking good questions,
I have the following problem that needs to be solved in a MySQL query:
I have problem understanding the meaning of join in the following case: Thread t1=new
I have the following problem, and am having trouble understanding part of the equation:
Hi all i have a problem in understanding the concept of retain in following
I have a problem in understanding the following methods...I have two works to done.
Help please, After numerous hours searching for the solution to my problem i have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.