Excellent!

That removed the warning.

Thanks...

I haven't seen any examples of this code anywhere, so for those that
want to get detailed information about the status of a GPS fix, this
code works.

-John Coryat


On Jul 11, 1:02 pm, Mark Murphy <[email protected]> wrote:
> Maps.Huge.Info (Maps API Guru) wrote:
>
>
>
> > Answered my own question, but now I have another...
>
> > In this code: (which works fine)
>
> > case GpsStatus.GPS_EVENT_SATELLITE_STATUS:
> >    GpsStatus xGpsStatus = locMgr.getGpsStatus(null) ;
> >    Iterable<GpsSatellite> iSatellites = xGpsStatus.getSatellites() ;
> >    Iterator it = iSatellites.iterator() ;
> >    while ( it.hasNext() )
> >    {
> >            GpsSatellite oSat = (GpsSatellite) it.next() ;
> >            Log.v("TEST","LocationActivity - onGpsStatusChange: Satellites: 
> > " +
> > oSat.getSnr() ) ;
> >    }
> >    break ;
>
> > there is a warning error on this line:
>
> >    Iterator it = iSatellites.iterator() ;
>
> > "Iterator is a raw type. References to generic type Iterator<E> should
> > be parameterized"
>
> > As I am a relative newcomer to Java, I can't find out how to fix this,
> > although the code runs as expected. Is this an important error or
> > something that can be ignored? I would prefer to fix it if possible.
>
> Try Iterator<GpsSatellite> instead of just Iterator. The code will run
> just fine in this case, but you lose any compile-time type-safety checks
> for down the road (e.g., you accidentally try assigning an
> Iterator<String> instead of an Iterator<GpsSatellite>).
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org
--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to