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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:47:00+00:00 2026-05-23T18:47:00+00:00

From My splash screen I start my Main Activity class . Main Activity contains

  • 0

From My splash screen I start my Main Activity class .

Main Activity contains a imagebutton from where I call other class(Second Screen) through explicit intent.

But Now after SpleshScreen time is over I got force close, but when I remove the explicit intent code of MainActivity.

After Splesh Screen.I get my MainActivity in perfect manner.>(But as i have to go in SecondScreen I put the code of explict Intent)

And I want flow like SpleshScreen->MainActivity->SecondScreen

My LogCat is showing following error

07-13 12:14:59.192: ERROR/AndroidRuntime(2455): Uncaught handler: thread main exiting due to uncaught exception
07-13 12:14:59.192: ERROR/AndroidRuntime(2455): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.ClassCastException: android.widget.ImageButton
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2558)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2574)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread.access$2400(ActivityThread.java:121)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1925)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.os.Looper.loop(Looper.java:136)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread.main(ActivityThread.java:4425)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at java.lang.reflect.Method.invokeNative(Native Method)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at java.lang.reflect.Method.invoke(Method.java:521)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at dalvik.system.NativeStart.main(Native Method)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455): Caused by: java.lang.ClassCastException: android.widget.ImageButton
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at com.rvappstudios.fingerslayarrr.MainActivity.onCreate(MainActivity.java:24)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2521)
07-13 12:14:59.192: ERROR/AndroidRuntime(2455):     ... 11 more
07-13 12:14:59.200: ERROR/ActivityManager(1188): SIGNAL_QUIT: to crashed process 2455

My MainActivity.java code of imagebutton to call my secondscreen

  public class MainActivity extends Activity 
{
    private Button play;

    //Called when first activity is created
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main1);

        play=(Button)findViewById(R.id.down);
        play.setOnClickListener(new OnClickListener() 
        {

            @Override
            public void onClick(View v)
            {
                Intent intent=new Intent(MainActivity.this,SecondScreen.class);

                startActivity(intent);


            }
        });

    }
}

My Menifest file code

<activity android:name=".SplashScreen"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name="MainActivity" 
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
   android:screenOrientation="portrait" >
   <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
  </activity>

   <activity android:name="SecondScreen" 
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
   android:screenOrientation="portrait" >
</activity>
  • 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-23T18:47:01+00:00Added an answer on May 23, 2026 at 6:47 pm

    Wild guess.

    Caused by: java.lang.ClassCastException: android.widget.ImageButton
    

    but you have

    private Button play;
    play=(Button)findViewById(R.id.down);
    

    Do you have Button or ImageButton in xml?

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

Sidebar

Related Questions

My app has a splash screen activity and that starts an intent for the
I want to play a sound while my splash screen gets data from the
The first activity in my app is a splash screen with a Progress Dialog
long time listener, first time caller... I am creating a splash screen derived from
I'm using a Splash Screen from Here . I love how simple it is.
Android Platform 1.5 I open splash screen at the end i call finish() then
My App starts with a splash screen loading background data from remote server. After
My animation works and when the thread ends, the intent for the next screen
I have a splash screen , a GridView , a simple text view .
I had been fooling around with an initial splash screen but decided not to

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.