Hi,
You can use Intent.getExtras(), instead of intent.getExtra(). The method
getExtras() returns a map of all the extras data.
You can use it just like any other map and search for keys like locaiton.
So,
Location loc = intent.getExtra("location") would become
Location loc = intent.getExtras().get("location")
Hope this helps!
-Megha
On Sun, May 11, 2008 at 9:06 PM, Trey Ethridge <[EMAIL PROTECTED]> wrote:
>
> I'm using the LocationManager to receive location updates via an
> IntentReceiver. The intent receiver looks something like this:
>
> public class handleLocationUpdate extends IntentReceiver {
> public void onReceiveIntent(Context context, Intent intent) {
> Location loc = (Location) intent.getExtra("location");
>
> Double lat = loc.getLatitude()*1E6;
> Double lng = loc.getLongitude()*1E6;
> Point point = new Point(lat.intValue(), lng.intValue());
> mapController.centerMapTo(point, false);
>
> setContentView(mapView);
> }
> }
>
>
> I see that the getExtra() method is now deprecated. The docs state to
> use the type safe methods now, but there isn't a type safe method for
> receiving "Location" objects, so what is the preferred way to retrieve
> the Location object from the intent now? I'm using sdk-m5-rc15.
>
> Thanks
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---