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 8062477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:40:54+00:00 2026-06-05T10:40:54+00:00

In my Android application, I have two activity classes. I have a button on

  • 0

In my Android application, I have two activity classes. I have a button on the first one and I want to show the second when it is clicked, but I get an error. Here are the classes:

public class SplashActivity extends Activity {
    Button b;

    @Override
    public void onCreate(Bundle bun) {
        // TODO Auto-generated method stub
        super.onCreate(bun);
        setContentView(R.layout.splash);

        b=(Button)findViewById(R.id.skipp);

        b.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                // TODO Auto-generated method stub
                startActivity (new Intent(SplashActivity.this, MCActivity.class));
            }
        });
    }

    @Override
    protected void onPause() 
        {
        // TODO Auto-generated method stub

        finish();
    }


}

Second class:

public class MCActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

And i have added

<activity android:name=".MCActivity" />

in manifest too,within <application> tags…

Still have the run time error activity stopped unexpectedly when i click on button b..

  • 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-06-05T10:40:57+00:00Added an answer on June 5, 2026 at 10:40 am

    Write Below onPause() Code

    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
        finish();
    }
    

    instead of your onPause Code.

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

Sidebar

Related Questions

I'm writing my first Android application and I have one activity that I'd like
I have an Android Honeycomb application with two activities; the first one has a
I have two activities; Home is my first activity and Settings is my second
I am developing android application but i don't know how to integrate two activity
I have two activities in my Android 2.1 application. The first is the Main
I have an Android application that contains two Activities . Activity A has a
I have a strange problem in my android application. I am starting one activity
I have two activities in an android application, each has a button that goes
I have two strings from an android application in ISO 8601 format that I
I am trying do a simple application for Android . I have two Activities

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.