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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:49:57+00:00 2026-06-08T14:49:57+00:00

I have this app it says it unexpectedly closed when i open it, here

  • 0

I have this app it says it unexpectedly closed when i open it, here is the main java… where the majority of the work is done, i really need as much help as i can get thank you all in advance

package geezer.quiz.app;


import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import geezer.quiz.app.score;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //---------------
        final TextView aText;
        final TextView bText;
        final TextView cText;
        final TextView dText;
        final TextView question;
        final CheckBox a1;
        final CheckBox b1;
        final CheckBox c1;
        final CheckBox d1;
        final TextView result;
        Button next;


        a1 = (CheckBox) findViewById(R.id.checkBox1);
        b1 = (CheckBox) findViewById(R.id.checkBox2);
        c1 = (CheckBox) findViewById(R.id.checkBox3);
        d1 = (CheckBox) findViewById(R.id.checkBox4);

        result = (EditText) findViewById(R.id.result);

        aText = (EditText) findViewById(R.id.textView1);
        bText = (EditText) findViewById(R.id.textView1);
        cText = (EditText) findViewById(R.id.textView1);
        dText = (EditText) findViewById(R.id.textView1);
        question = (EditText)findViewById(R.id.questionText);
        next = (Button) findViewById(R.id.button1);

        final String a[] = new String[5]; 
        final String b[] = new String[5];
        final String c[] = new String[5];
        final String d[] = new String[5];
        final String questions[]= new String [5];

        a[0] = "Bell Bottoms";
        a[1] = "Far Out";
        a[2] = "Insanity";
        a[3] = "Tye Dye";
        a[4] = "Yes";

        b[0] = "Speedos";
        b[1] = "Solid";
        b[2] = "Calvin Harris";
        b[3] = "Love Beads";
        b[4] = "Maybe";

        c[0] = "Plaid";
        c[1] = "Norm";
        c[2] = "Cobra Starship";
        c[3] = "Bell Bottoms";
        c[4] = "Later";

        d[0] = "Flannel";
        d[1] = "Radical";
        d[2] = "David Guetta";
        d[3] = "Granny Glasses";
        d[4] = "Never";

        questions[0] = "Which is the most in style?";
        questions[1] = "Which term is used most?";
        questions[2] = "Four musical artists are listed, which is fake?";
        questions[3] = "Which of these is the most embarrasing?";
        questions[4] = "If someone proposed you join a Golly Gee club how would you respond?";



         next.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {


            score.q ++;

            boolean q1a = false;
            boolean q1b = false;
            boolean q1c = false;
            boolean q1d = false;
            boolean q2a = false;
            boolean q2b = false;
            boolean q2c = false;
            boolean q2d = false;
            boolean q3a = false;
            boolean q3b = false;
            boolean q3c = false;
            boolean q3d = false;
            boolean q4a = false;
            boolean q4b = false;
            boolean q4c = false;
            boolean q4d = false;
            boolean q5a = false;
            boolean q5b = false;
            boolean q5c = false;
            boolean q5d = false;



                    aText.setText(a[score.q]); 
                    bText.setText(b[score.q]);
                    cText.setText(c[score.q]);
                    dText.setText(d[score.q]);

                    question.setText(questions[score.q]); 


                    if(d1.isChecked() && score.q == 0) {
                        q1d = true;
                        score.score++;
                    }


                    if(c1.isChecked() && score.q == 1) {
                        q2c = true;
                        score.score++;
                    }

                    if(a1.isChecked() && score.q == 2) {
                        q3a = true;
                        score.score++;
                    }

                    if(d1.isChecked() && score.q == 3) {
                        q4d = true;
                        score.score++;
                    }


                    if(d1.isChecked() && score.q == 4) {
                        q5d = true;
                        score.score++;

                        if( score.score >2 && score.q == 4){
                             result.setText("You are not a geezer");
                         }
                        if( score.score <3 && score.q == 4){
                             result.setText("You are indeed a geezer");
                         }

                }
            }

         });

    }



    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


}

here is the second java file (score)… i just have two variables in here

package geezer.quiz.app;

import geezer.quiz.app.MainActivity;

public class score {



    protected static int score = 0;
    protected static int q =-1;

    /**
     * @param args
     */
    public static void main(String[] args) {

    }

}

here is the logcat, i don’t know what any of this means… and i meant to provide this, i am sorry i forgot…

07-28 23:45:23.542: D/AndroidRuntime(411): Shutting down VM
07-28 23:45:23.542: W/dalvikvm(411): threadid=1: thread exiting with uncaught exception (group=0x40014760)
07-28 23:45:23.576: E/AndroidRuntime(411): FATAL EXCEPTION: main
07-28 23:45:23.576: E/AndroidRuntime(411): java.lang.RuntimeException: Unable to start activity ComponentInfo{geezer.quiz.app/geezer.quiz.app.MainActivity}: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread.access$500(ActivityThread.java:122)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.os.Looper.loop(Looper.java:132)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread.main(ActivityThread.java:4123)
07-28 23:45:23.576: E/AndroidRuntime(411):  at java.lang.reflect.Method.invokeNative(Native Method)
07-28 23:45:23.576: E/AndroidRuntime(411):  at java.lang.reflect.Method.invoke(Method.java:491)
07-28 23:45:23.576: E/AndroidRuntime(411):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-28 23:45:23.576: E/AndroidRuntime(411):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-28 23:45:23.576: E/AndroidRuntime(411):  at dalvik.system.NativeStart.main(Native Method)
07-28 23:45:23.576: E/AndroidRuntime(411): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
07-28 23:45:23.576: E/AndroidRuntime(411):  at geezer.quiz.app.MainActivity.onCreate(MainActivity.java:40)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.Activity.performCreate(Activity.java:4397)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
07-28 23:45:23.576: E/AndroidRuntime(411):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
07-28 23:45:23.576: E/AndroidRuntime(411):  ... 11 more
07-28 23:46:32.822: I/Process(411): Sending signal. PID: 411 SIG: 9
07-28 23:48:24.712: D/AndroidRuntime(420): Shutting down VM
07-28 23:48:24.722: W/dalvikvm(420): threadid=1: thread exiting with uncaught exception (group=0x40014760)
07-28 23:48:24.742: E/AndroidRuntime(420): FATAL EXCEPTION: main
07-28 23:48:24.742: E/AndroidRuntime(420): java.lang.RuntimeException: Unable to start activity ComponentInfo{geezer.quiz.app/geezer.quiz.app.MainActivity}: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1815)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread.access$500(ActivityThread.java:122)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.os.Looper.loop(Looper.java:132)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread.main(ActivityThread.java:4123)
07-28 23:48:24.742: E/AndroidRuntime(420):  at java.lang.reflect.Method.invokeNative(Native Method)
07-28 23:48:24.742: E/AndroidRuntime(420):  at java.lang.reflect.Method.invoke(Method.java:491)
07-28 23:48:24.742: E/AndroidRuntime(420):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
07-28 23:48:24.742: E/AndroidRuntime(420):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
07-28 23:48:24.742: E/AndroidRuntime(420):  at dalvik.system.NativeStart.main(Native Method)
07-28 23:48:24.742: E/AndroidRuntime(420): Caused by: java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText
07-28 23:48:24.742: E/AndroidRuntime(420):  at geezer.quiz.app.MainActivity.onCreate(MainActivity.java:40)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.Activity.performCreate(Activity.java:4397)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
07-28 23:48:24.742: E/AndroidRuntime(420):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
07-28 23:48:24.742: E/AndroidRuntime(420):  ... 11 more
  • 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-08T14:49:59+00:00Added an answer on June 8, 2026 at 2:49 pm

    The stack trace tells you exactly what the problem is:

    android.widget.TextView cannot be cast to android.widget.EditText
    

    …which means that one of these casts is not valid, because the view you’re trying to cast to an EditText is actually a TextView:

    result = (EditText) findViewById(R.id.result);
    
    aText = (EditText) findViewById(R.id.textView1);
    bText = (EditText) findViewById(R.id.textView1);
    cText = (EditText) findViewById(R.id.textView1);
    dText = (EditText) findViewById(R.id.textView1);
    question = (EditText)findViewById(R.id.questionText);
    

    It’s at MainActivity.java line 40, again, as the stack strace tells you:

    07-28 23:45:23.576: E/AndroidRuntime(411):  at geezer.quiz.app.MainActivity.onCreate(MainActivity.java:40)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this UITableView app, a basic diary app, in this method XCode says
I have this app (contacts style) in which you can add instances to a
So I have this app which needs to query entities from the Azure Tables
So I have this App in the store, and I would like to release
I have this code App.Model('users').find(function (err, users) { users.forEach(function(user) { console.log(user.username); }); }); //make
I have this RoR app that calls to RAILS_ROOT. When running it using rails
I have this code: app = new Application(); app.Visible = false; workbook = app.Workbooks.Add(1);
I have this iPad app using Storyboard. There are some file that are marked
I copied this class from a similar class I have in this app that
So, I have this desktop app built using WPF and C#. It's basically an

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.