All good points!

In particular, the OP should have told us what the warning suppressed
really was. It might have been the hint he needed to solve the
problem. Or it might have been just another attempt to suppress the
spurious warning messages from Eclipse -- which sometimes says you
need to Override a method you have already Overriden.

And just to connect a few dots: the easiest way to get to Logcat and
search the output is to switch to DDMS perspective, find the Logcat
tab, bring it to the front and maximize it. Then you can delete the
previous contents of the log and just watch the world scroll by. Or
play around with filters, though that is not necessary for this
problem.

It also helps to watch this Logcat output on a known good program run,
so that you can get used to which error message can be ignored.
Unfortunately, even for a program running perfectly OK on the
emulator, we see Java exceptions and other error messages in Logcat.

On Apr 21, 12:51 am, Justin Anderson <janderson....@gmail.com> wrote:
> First thing I noticed right off the bat is that you aren't checking for the
> case where the input can't be parsed to a double...  That throws an
> exception and since you aren't handling that that would crash your app.
>
> Second thing I noticed is that hideous @SuppressWarnings thing....  In my
> opinion if you need to do that then you need to rethink what you are doing.
>
> Last, but not least, check the logcat output when you get a crash... it will
> tell you more about why it is crashing.
>
> ----------------------------------------------------------------------
> There are only 10 types of people in the world...
> Those who know binary and those who don't.
> ----------------------------------------------------------------------
>
>
>
> On Tue, Apr 20, 2010 at 9:35 PM, Traveler <jadkins...@gmail.com> wrote:
> > package Adkins.GMTpackage;
>
> > import android.app.Activity;
> > 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. */
> >   �...@override
> >    public void onCreate(Bundle icicle) {
> >        super.onCreate(icicle);
> >        setContentView(R.layout.main);
>
> >        title = (TextView)this.findViewById(R.id.title);
> >        minsattitle = (TextView)this.findViewById(R.id.minsattitle);
> >        minustitle = (TextView)this.findViewById(R.id.minustitle);
> >        gmtinput = (TextView)this.findViewById(R.id.gmtinput);
> >        gmtbutton = (Button)this.findViewById(R.id.gmtbutton);
> >        gmtbutton.setOnClickListener(this);
> >    }
>
> >        public void onClick(View v) {
> >                calculateGmt();
> >        }
>
> >       �...@suppresswarnings("null")
> >        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));
> >        }
> > }
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Beginners" group.
>
> > NEW! Try asking and tagging your question on Stack Overflow at
> >http://stackoverflow.com/questions/tagged/android
>
> > To unsubscribe from this group, send email to
> > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-beginners?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow 
> athttp://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to