Back to project page androidtool.
The source code is released under:
MIT License
If you think the Android project androidtool listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.chris.android.tool.gps; /*from www .j a v a2 s .co m*/ import android.location.GpsStatus; import android.util.SparseArray; public enum GpsStatusType { GPS_EVENT_STARTED(GpsStatus.GPS_EVENT_STARTED), GPS_EVENT_STOPPED(GpsStatus.GPS_EVENT_STOPPED), GPS_EVENT_FIRST_FIX(GpsStatus.GPS_EVENT_FIRST_FIX), GPS_EVENT_SATELLITE_STATUS(GpsStatus.GPS_EVENT_SATELLITE_STATUS); private final int state; private final static SparseArray<GpsStatusType> states = new SparseArray<>(); static { for (GpsStatusType val : values()) { states.put(val.state, val); } } private GpsStatusType(int state) { this.state = state; } public static GpsStatusType forId(int id) { return states.get(id); } }