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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:11:51+00:00 2026-06-15T09:11:51+00:00

My app force closes as soon as I open it, this is my first

  • 0

My app force closes as soon as I open it,
this is my first app, and I have tried to find errors, but I can’t
I have attached log cat since starting this app:

          12-03 16:04:54.040: W/dalvikvm(8798): threadid=1: thread exiting with uncaught exception (group=0x40018578)
          12-03 16:04:54.040: E/AndroidRuntime(8798): FATAL EXCEPTION: main
          12-03 16:04:54.040: E/AndroidRuntime(8798): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sditya.quadratic.equation/com.sditya.quadratic.equation.Quadratic}: java.lang.NullPointerException
          ...
          12-03 16:04:54.040: E/AndroidRuntime(8798): Caused by: java.lang.NullPointerException
          12-03 16:04:54.040: E/AndroidRuntime(8798):   at com.sditya.quadratic.equation.Quadratic.initialize(Quadratic.java:58)

The initialize method:

private void initialize() { 
// TODO Auto-generated method stub
tr = (TextView) findViewById(R.id.tvResults); 
xs = (EditText) findViewById(R.id.editText1);
x = (EditText) findViewById(R.id.editText2); 
c = (EditText) findViewById(R.id.editText3); 
b.setOnClickListener(this); 
} 

Edit: Resolved, I forgot to inflate 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-15T09:11:52+00:00Added an answer on June 15, 2026 at 9:11 am

    In your initialize method, you need to set the button variable before setting the listener..

    private void initialize() { 
    // TODO Auto-generated method stub
    tr = (TextView) findViewById(R.id.tvResults); 
    xs = (EditText) findViewById(R.id.editText1);
    x = (EditText) findViewById(R.id.editText2); 
    c = (EditText) findViewById(R.id.editText3); 
    
    b = (Button) findViewById(R.id.button1); 
    b.setOnClickListener(this); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app on the market, but in some cases it force closes
This activity is supposed to call another activity, but instead it force closes the
This is a location based app.The MainActivity.java is the first file to get executed,But
Here's the code for my JSON parsing app. It force closes as soon as
When I start my (soon-to-be) android game (from eclipse) it opens, but immediately force-closes.
my app is getting force close randomly. And every time error can not be
Hi I want to make a small test window app that can force IE
Im not sure why, but my app all of a sudden keeps force closing
Okay, I've got my normal app which is in portrait mode. I can force
My app force closes when I try to launch the same MapActivity from the

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.