public abstract interface LocationSource
LocationSource定义了一个位置源,提供定位数据。
无
无
| Return type | Method name |
| abstract void | activate(LocationSource.OnLocationChangedListener listener) |
| abstract void | deactivate() |
| Class | Function |
| LocationSource.OnLocationChangedListener | 位置改变监听器。 |
| Method |
| public abstract void activate(LocationSource.OnLocationChangedListener listener) |
| 开发者调用此API可以激活位置源,并监听位置更新。 |
Parameters:
| Parameter name | Parameter desc |
| listener | 位置改变监听器。 |
Return:
无
Exception:
| Exception type | Scenario |
| IllegalStateException | 提供的位置源已经激活。 |
| IllegalArgumentException | 监听器为null。 |
| Method |
| public abstract void deactivate() |
| 开发者调用此API停用位置源。 |
Parameters:
无
Return:
无
Exception:
| Exception type | Scenario |
| IllegalStateException | 位置源没有被激活。 |