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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:41:13+00:00 2026-06-09T20:41:13+00:00

So I put this project aside a few weeks ago and it worked perfectly.

  • 0

So I put this project aside a few weeks ago and it worked perfectly. I made a few changes to one of the activities earlier today, loaded it into the emulator, and it died after getting to my menu screen (splash –> menu –> new activities). So after two crashes, I tried a different activity. One worked. Back… clicked another that hasn’t been touched, boom. Force close/crash. I haven’t changed anything in the menu java or XML file, nor the manifest.

What in the world could be causing this? There are no errors in Eclipse and I haven’t changed anything, I thought, to cause it to do this.

log attached:


08-14 14:34:45.301: W/KeyCharacterMap(343): No keyboard for id 0
08-14 14:34:45.301: W/KeyCharacterMap(343): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
08-14 14:35:40.461: D/AndroidRuntime(343): Shutting down VM
08-14 14:35:40.471: W/dalvikvm(343): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-14 14:35:40.491: E/AndroidRuntime(343): FATAL EXCEPTION: main
08-14 14:35:40.491: E/AndroidRuntime(343): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tomcat.performance/com.tomcat.performance.TireTemps}: java.lang.NullPointerException
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.os.Looper.loop(Looper.java:123)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread.main(ActivityThread.java:4627)
08-14 14:35:40.491: E/AndroidRuntime(343):  at java.lang.reflect.Method.invokeNative(Native Method)
08-14 14:35:40.491: E/AndroidRuntime(343):  at java.lang.reflect.Method.invoke(Method.java:521)
08-14 14:35:40.491: E/AndroidRuntime(343):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-14 14:35:40.491: E/AndroidRuntime(343):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-14 14:35:40.491: E/AndroidRuntime(343):  at dalvik.system.NativeStart.main(Native Method)
08-14 14:35:40.491: E/AndroidRuntime(343): Caused by: java.lang.NullPointerException
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.Activity.findViewById(Activity.java:1637)
08-14 14:35:40.491: E/AndroidRuntime(343):  at com.tomcat.performance.TireTemps.<init>(TireTemps.java:25)
08-14 14:35:40.491: E/AndroidRuntime(343):  at java.lang.Class.newInstanceImpl(Native Method)
08-14 14:35:40.491: E/AndroidRuntime(343):  at java.lang.Class.newInstance(Class.java:1429)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-14 14:35:40.491: E/AndroidRuntime(343):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-14 14:35:40.491: E/AndroidRuntime(343):  ... 11 more

TIRETEMPS.JAVA

package com.tomcat.performance;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
package com.tomcat.performance;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class TireTemps extends Activity implements OnClickListener {
    EditText tempLFouterString = ((EditText) findViewById(R.id.tempLFouter)),
            tempLFmiddleString = ((EditText) findViewById(R.id.tempLFmiddle)),
            tempLFinnerString = ((EditText) findViewById(R.id.tempLFinner)),
            tempRFinnerString = ((EditText) findViewById(R.id.tempRFinner)),
            tempRFmiddleString = ((EditText) findViewById(R.id.tempRFmiddle)),
            tempRFouterString = ((EditText) findViewById(R.id.tempRFouter)),
            tempRRinnerString = ((EditText) findViewById(R.id.tempRRinner)),
            tempRRmiddleString = ((EditText) findViewById(R.id.tempRRmiddle)),
            tempRRouterString = ((EditText) findViewById(R.id.tempRRouter)),
            tempLRouterString = ((EditText) findViewById(R.id.tempLRouter)),
            tempLRmiddleString = ((EditText) findViewById(R.id.tempLRmiddle)),
            tempLRinnerString = ((EditText) findViewById(R.id.tempLRinner));

    TextView tempNoseAverageString = ((TextView) findViewById(R.id.tempNoseAverage)),
            tempLFaverageString = ((TextView) findViewById(R.id.tempLFaverage)),
            tempRFaverageString = ((TextView) findViewById(R.id.tempRFaverage)),
            tempLRaverageString = ((TextView) findViewById(R.id.tempLRaverage)),
            tempRRaverageString = ((TextView) findViewById(R.id.tempRRaverage)),
            tempRearAverageString = ((TextView) findViewById(R.id.tempRearAverage)),
            tempRFLRaverageString = ((TextView) findViewById(R.id.tempRFLRaverage)),
            tempLFRRaverageString = ((TextView) findViewById(R.id.tempLFRRaverage)),
            tempRSaverageString = ((TextView) findViewById(R.id.tempRSaverage)),
            tempLSaverageString = ((TextView) findViewById(R.id.tempLSaverage));

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tiretemps);

        Button calculate = ((Button) findViewById(R.id.calculate));
        calculate.setOnClickListener( new View.OnClickListener() {
            public void onClick(View arg0) {
                double tempLFouter, tempLFmiddle, tempLFinner, tempRFinner, tempRFmiddle, 
                       tempRFouter, tempLRouter, tempLRmiddle, tempLRinner, tempRRinner, 
                       tempRRmiddle, tempRRouter, tempNoseAverage, tempLFaverage, tempRFaverage, 
                       tempLRaverage, tempRRaverage, tempRearAverage, tempRFLRaverage, tempLFRRaverage, 
                       tempLSaverage, tempRSaverage;

                try {
                    tempLFouter = Double.parseDouble(tempLFouterString.getText().toString());
                    tempLFinner = Double.parseDouble(tempLFinnerString.getText().toString());
                    tempLFmiddle = Double.parseDouble(tempLFmiddleString.getText().toString());
                    tempRFouter = Double.parseDouble(tempRFouterString.getText().toString());
                    tempRFmiddle = Double.parseDouble(tempRFmiddleString.getText().toString());
                    tempRFinner = Double.parseDouble(tempRFinnerString.getText().toString());
                    tempRRouter = Double.parseDouble(tempRRouterString.getText().toString());
                    tempRRmiddle = Double.parseDouble(tempRRmiddleString.getText().toString());
                    tempRRinner = Double.parseDouble(tempRRinnerString.getText().toString());
                    tempLRouter = Double.parseDouble(tempLRouterString.getText().toString());
                    tempLRmiddle = Double.parseDouble(tempLRmiddleString.getText().toString());
                    tempLRinner = Double.parseDouble(tempLRinnerString.getText().toString());

                    tempLFaverage = ((tempLFinner + tempLFmiddle + tempLFouter) / 3);
                    tempRFaverage = ((tempRFinner + tempRFmiddle + tempRFouter) / 3);
                    tempLRaverage = ((tempLRinner + tempLRmiddle + tempLRouter) / 3);
                    tempRRaverage = ((tempRRinner + tempRRmiddle + tempRRouter) / 3);
                    tempNoseAverage = ((tempLFaverage + tempRFaverage) / 2);
                    tempRearAverage = ((tempLRaverage + tempRRaverage) / 2);
                    tempRFLRaverage = ((tempRFaverage + tempLRaverage) / 2);
                    tempLFRRaverage = ((tempLFaverage + tempRRaverage) / 2);
                    tempLSaverage = ((tempLFaverage + tempLRaverage) / 2);
                    tempRSaverage = ((tempRFaverage + tempRRaverage) / 2);

                    tempNoseAverageString.setText(String.valueOf(String.format("%.1f", tempNoseAverage)) + "°");
                    tempLFaverageString.setText(String.valueOf(String.format("%.1f", tempLFaverage)) + "°");
                    tempRFaverageString.setText(String.valueOf(String.format("%.1f", tempRFaverage)) + "°");
                    tempLRaverageString.setText(String.valueOf(String.format("%.1f", tempLRaverage)) + "°");
                    tempRRaverageString.setText(String.valueOf(String.format("%.1f", tempRRaverage)) + "°");
                    tempRearAverageString.setText(String.valueOf(String.format("%.1f", tempRearAverage)) + "°");
                    tempRFLRaverageString.setText(String.valueOf(String.format("%.1f", tempRFLRaverage)) + "°");
                    tempLFRRaverageString.setText(String.valueOf(String.format("%.1f", tempLFRRaverage)) + "°");
                    tempLSaverageString.setText(String.valueOf(String.format("%.1f", tempLSaverage)) + "°");
                    tempRSaverageString.setText(String.valueOf(String.format("%.1f", tempRSaverage)) + "°");

                } catch (NumberFormatException e) {
                    Toast andEggs = Toast
                            .makeText(TireTemps.this,
                             "Please verify only numbers are used in your inputs with no blank data.",
                             Toast.LENGTH_LONG);
                    andEggs.show();
                } catch (NullPointerException n) {
                    Toast andEggs = Toast.makeText(TireTemps.this, "Please enter all temperature data for each tire.",
                            Toast.LENGTH_LONG);
                    andEggs.show();
                }
            }
        });

        Button reset_temps = ((Button) findViewById(R.id.reset_temps));
        reset_temps.setOnClickListener( new View.OnClickListener() {
            public void onClick(View arg0) {
                tempLFouterString.setText("");
                tempLFinnerString.setText("");
                tempLFmiddleString.setText("");
                tempRFouterString.setText("");
                tempRFmiddleString.setText("");
                tempRFinnerString.setText("");
                tempRRouterString.setText("");
                tempRRmiddleString.setText("");
                tempRRinnerString.setText("");
                tempLRouterString.setText("");
                tempLRmiddleString.setText("");
                tempLRinnerString.setText("");

                tempNoseAverageString.setText("");
                tempLFaverageString.setText("");
                tempRFaverageString.setText("");
                tempLRaverageString.setText("");
                tempRRaverageString.setText("");
                tempRearAverageString.setText("");
                tempRFLRaverageString.setText("");
                tempLFRRaverageString.setText("");
                tempLSaverageString.setText("");
                tempRSaverageString.setText("");

                Toast andEggs = Toast.makeText(TireTemps.this, "All data has been reset.", Toast.LENGTH_LONG);
                andEggs.show();

            }
        });
    }

    public void onClick(View arg0) {
        // TODO Auto-generated method stub

    }
}

EDIT: Added TireTemps.java

  • 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-09T20:41:14+00:00Added an answer on June 9, 2026 at 8:41 pm

    findviewbyid works only after you have done a setContentView. But you are instantiating all the EditTexts at class instantiation itself. There is no way that findviewbyid will know where to look for the ids.

    Move all the findviewbyid that you have done in field instantiation to Oncreate.

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

Sidebar

Related Questions

I am having trouble trying to put in data for this project I'm working
In my ASP.NET project. I put my css file in \App_Themes\Default\theme.css This is right
A team member put this into our project $(function() { $(body).bind(ajaxError, function(event, XMLHttpRequest, ajaxOptions,
I have a .Net project called: Whatever.Web.UI: I use this project to put all
If I create a Tab Bar Application project template with storybard and put this
I've recently started to rewrite a project I did a few years ago using
I created a project in zendframework: zf create project dev.gamenomad.com Then, I put this:
I'm not trying to put fuel on the table/div debate, for this project I've
I have started a new iOS Empty Application -template project. When I put this
While working on a project today I ran into this odd behavior in .NET.

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.