public abstract class CountryDetectorBase extends Object
Calling detectCountry()
to start detecting the country. The country
could be returned immediately if it is available.
Modifier and Type | Field and Description |
---|---|
protected Context |
mContext |
protected Country |
mDetectedCountry |
protected Handler |
mHandler |
protected CountryListener |
mListener |
Constructor and Description |
---|
CountryDetectorBase(Context ctx) |
Modifier and Type | Method and Description |
---|---|
abstract Country |
detectCountry()
Start detecting the country that the user is in.
|
protected void |
notifyListener(Country country) |
void |
setCountryListener(CountryListener listener)
Register a listener to receive the notification when the country is detected or changed.
|
abstract void |
stop()
Stop detecting the country.
|
protected final Handler mHandler
protected final Context mContext
protected CountryListener mListener
protected Country mDetectedCountry
public CountryDetectorBase(Context ctx)
public abstract Country detectCountry()
public void setCountryListener(CountryListener listener)
The previous listener will be replaced if it exists.
public abstract void stop()
protected void notifyListener(Country country)