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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:25:59+00:00 2026-05-28T21:25:59+00:00

I’m having some trouble switching activities. I’m thinking it has something to do with

  • 0

I’m having some trouble switching activities. I’m thinking it has something to do with my viewflipper. Whenever I click the button “Start Game” to switch to the game activity, it throws the error “thread main exiting due to uncaught exception”. Can anyone give me a hand? I know for sure it cannot be the start game activity and its layout, both are too simple to fail. Like I said, I think it has something to do with my viewflipper. Going even further, I want to explain more. The activity starts off with a view that has username, password, and login edittexts/buttons, then, when the user and pass is accepted, it flips the view to the main menu. From there, you press start game.

 package com.login.test;

 import java.util.Timer;
 import java.util.TimerTask;
 import android.app.Activity;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Handler;
 import android.view.View;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.Toast;
 import android.widget.ViewFlipper;

 public class Login extends Activity {

public EditText username, password;
public Button loginbutton, start, stats;
public ViewFlipper flip;
public String dbu, dbp;
final Handler handler = new Handler(); 
Timer t = new Timer(); 
public static final String KEEP_INFO = "remeberinfo";

public void startgame() {

    Intent myIntent = new Intent(Login.this, Game.class);
    startActivity(myIntent);

}

public void seescore() {

    Intent myIntent2 = new Intent(Login.this, Score.class);
    startActivity(myIntent2);

}


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.login);




    username = (EditText) this.findViewById(R.id.username);
    password = (EditText) this.findViewById(R.id.password);        
    loginbutton = (Button) this.findViewById(R.id.loginbutton);
    start = (Button) this.findViewById(R.id.start);
    stats = (Button) this.findViewById(R.id.stats);
    flip = (ViewFlipper) this.findViewById(R.id.flip);
    //when a view is displayed
    flip.setInAnimation(this,android.R.anim.fade_in);
   //when a view disappears
    flip.setOutAnimation(this, android.R.anim.fade_out);
    final Toast accessdenied = Toast.makeText(getApplicationContext(), "Incorrect username/password", 3);
    final Toast accessgranted = Toast.makeText(getApplicationContext(), "Logging in", 3);

    //calling for a stored data byte using sharedpreferences
    SharedPreferences settings = getSharedPreferences(KEEP_INFO,0);
    String keptusername = settings.getString("keptuser", "");
    String keptpassword = settings.getString("keptpass", "");

    username.setText(keptusername);
    password.setText(keptpassword);



    loginbutton.setOnClickListener(new View.OnClickListener() {



        public void onClick(View v) {

            dbu = (username.getText()).toString();
            dbp = (password.getText()).toString();

            try{

            }
            finally{
                if ((dbu.equals("crete"))&&(dbp.equals("monee"))){
                    username.setBackgroundResource(R.drawable.greenloginbutton);
                    password.setBackgroundResource(R.drawable.greenloginbutton);
                    loginbutton.setBackgroundResource(R.drawable.greenloginbutton);
                    accessgranted.show();
                    //setting and valuing a data byte using sharedpreferences
                    SharedPreferences info = getSharedPreferences(KEEP_INFO,0);
                    SharedPreferences.Editor editor = info.edit();
                    editor.putString("keptuser", dbu);
                    editor.putString("keptpass", dbp);
                    editor.commit();
                    t.schedule(new TimerTask() { 
                        public void run() { 
                                handler.post(new Runnable() { 
                                        public void run() { 
                                            flip.showNext();
                                        } 
                                }); 
                            } 
                    }, 2000); 

                }
                else {

                    t.schedule(new TimerTask() { 
                            public void run() { 
                                    handler.post(new Runnable() { 
                                            public void run() { 
                                                username.setBackgroundResource(R.drawable.loginbutton);
                                                password.setBackgroundResource(R.drawable.loginbutton);
                                                loginbutton.setBackgroundResource(R.drawable.loginbutton);
                                            } 
                                    }); 
                            } 
                    }, 3000); 

                    accessdenied.show();
                    username.setBackgroundResource(R.drawable.redloginbutton);
                    password.setBackgroundResource(R.drawable.redloginbutton);
                    loginbutton.setBackgroundResource(R.drawable.redloginbutton);
                }
            }

        }
    });

    start.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            startgame();

        }
    });

    stats.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            seescore();

        }
    });

     }
 }

LOG CAT

 01-28 12:03:56.125: D/dalvikvm(322): GC freed 594 objects / 48504 bytes in 172ms
 01-28 12:03:57.065: D/dalvikvm(322): GC freed 49 objects / 1904 bytes in 131ms
 01-28 12:03:57.838: D/ViewFlipper(322): updateRunning() mVisible=true, mStarted=false,          mUserPresent=true, mRunning=false
 01-28 12:04:09.176: D/AndroidRuntime(322): Shutting down VM
 01-28 12:04:09.185: W/dalvikvm(322): threadid=3: thread exiting with uncaught      exception (group=0x4001b188)
 01-28 12:04:09.195: E/AndroidRuntime(322): Uncaught handler: thread main exiting due      to uncaught exception
 01-28 12:04:09.267: E/AndroidRuntime(322): android.content.ActivityNotFoundException:      Unable to find explicit activity class      {com.beeseries.contextclues/com.beeseries.contextclues.Game}; have you declared this      activity in your AndroidManifest.xml?
 01-28 12:04:09.267: E/AndroidRuntime(322):     at      android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at      android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.app.Activity.startActivityForResult(Activity.java:2749)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.app.Activity.startActivity(Activity.java:2855)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.beeseries.contextclues.Login.startgame(Login.java:29)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.beeseries.contextclues.Login$2.onClick(Login.java:136)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.View.performClick(View.java:2364)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.View.onTouchEvent(View.java:4179)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.widget.TextView.onTouchEvent(TextView.java:6540)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.View.dispatchTouchEvent(View.java:3709)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.os.Handler.dispatchMessage(Handler.java:99)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.os.Looper.loop(Looper.java:123)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at android.app.ActivityThread.main(ActivityThread.java:4363)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at java.lang.reflect.Method.invokeNative(Native Method)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at java.lang.reflect.Method.invoke(Method.java:521)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
 01-28 12:04:09.267: E/AndroidRuntime(322):     at dalvik.system.NativeStart.main(Native Method)
 01-28 12:04:09.315: I/dalvikvm(322): threadid=7: reacting to signal 3
 01-28 12:04:09.435: I/dalvikvm(322): Wrote stack trace to '/data/anr/traces.txt'
 01-28 12:04:12.485: I/Process(322): Sending signal. PID: 322 SIG: 9
  • 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-28T21:26:00+00:00Added an answer on May 28, 2026 at 9:26 pm

    You probably didn’t declare your Game Activity in the AndroidManifest.xml, something like this:

    <activity android:name=".Game"
    <!-- other attributes and also possible intent-filters.-->
     />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
Specifically, suppose I start with the string string =hello \'i am \' me And

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.