Any idea why the following code crashes the app? It happens in calculateGmt()

by Traveler » Wed, 21 Apr 2010 11:35:31 GMT

Sponsored Links
 package Adkins.GMTpackage;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.EditText;

public class GMTactivity extends Activity implements OnClickListener {
        TextView title;
        TextView minsattitle;
        TextView minustitle;
        TextView minsatoutput;
        TextView minusoutput;
        TextView gmtinput;
    Button gmtbutton;

        /** Called when the activity is first created. */
    public void onCreate(Bundle icicle) {

        title = (TextView)this.findViewById(;
        minsattitle = (TextView)this.findViewById(;
        minustitle = (TextView)this.findViewById(;
        gmtinput = (TextView)this.findViewById(;
        gmtbutton = (Button)this.findViewById(;

        public void onClick(View v) {

        protected void calculateGmt() {

                double val = Double.parseDouble(gmtinput.getText().toString());
                // in a real app, we'd get this off the 'net
                minsatoutput.setText(Double.toString(val * 2));


Other Threads

1. headphone intent receiving

Hi there,

I've been working on an application to detect when the headset is plugged
in.  My application can successfully receive broadcast intents such as
airplane mode but when I plug my headphones in nothing happens with my app.
If I triger the headset plugged intent in another app then my application
runs correctly.  My phone is also aware of the headset being plugged and
unplugged in 99.9999% of the time.

Does anybody have any ideas.  Are there any permissions I'm missing?  How
would I go about debugging the problem?

Thanks for the help


2. Debug on a remote emulator


I am running Eclipse on Win32 and my Android emulator on Linux.

Is there a way to use Win32 eclipse to debug code on the emulator that
runs on Linux?


3. Log.d() show same log twice in logcat

4. View id names for native android layouts

5. Emulator Startup Problem

6. How can I load resources from Jar files?

7. How to mark a test to be @SmallTest OR @MediumTest OR @LargeTest