The exception shown in logcat after the crash will tell you more
information about why your app is crashing. If you are trying to use a
system service before onCreate, for example, it will let you know,
etc.. One way to get to logcat is to go to Logcat view in the DDMS
Perspective in Eclipse.

On Feb 19, 3:55 pm, "korben...@gmail.com" <korben...@gmail.com> wrote:
> I am designing a location based program for Android and I am having a
> problem. Right now I am just trying to retrieve the GPS coordinates
> and display them to the screen. I put the following code in my program
> and now whenever try to run it in the emulator the program crashes and
> I have to force quit.
>
>        LocationManager mylocation =
> (LocationManager)getSystemService(Context.LOCATION_SERVICE)
>        mylocation.requestLocationUpdates(LocationManager.GPS_PROVIDER,
> 0, 0, this);
>
> If i comment out the second line the program runs, but obviously i
> can't retrieve the data I need without it. Any suggestions? help would
> be much appreciated. thanks.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to