本文整理汇总了Java中com.tencent.map.geolocation.TencentLocationRequest.setInterval方法的典型用法代码示例。如果您正苦于以下问题:Java TencentLocationRequest.setInterval方法的具体用法?Java TencentLocationRequest.setInterval怎么用?Java TencentLocationRequest.setInterval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.tencent.map.geolocation.TencentLocationRequest
的用法示例。
在下文中一共展示了TencentLocationRequest.setInterval方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
public void startLocation(View view) {
// 创建定位请求
TencentLocationRequest request = TencentLocationRequest.create();
// 修改定位请求参数, 定位周期 3000 ms
request.setInterval(3000);
Looper otherLooper = mThread.getLooper();
if (mIndex == BG_THREAD) {
// 开始定位, 在 mThread 线程中
mLocationManager.requestLocationUpdates(request, this, otherLooper);
} else if (mIndex == MAIN_THREAD) {
// 开始定位, 在主线程中
mLocationManager.requestLocationUpdates(request, this);
}
updateLocationStatus("开始定位: " + request + ", 坐标系="
+ DemoUtils.toString(mLocationManager.getCoordinateType()));
}
示例2: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
public void startLocation(View view) {
// 创建定位请求
final TencentLocationRequest request = TencentLocationRequest.create();
// 修改定位请求参数, 定位周期 3000 ms
request.setInterval(3000);
// 在 mThread 线程发起定位
mHandler.post(new Runnable() {
@Override
public void run() {
mLocationManager.requestLocationUpdates(request,
DemoThreadActivity2.this);
}
});
updateLocationStatus("开始定位: " + request + ", 坐标系="
+ DemoUtils.toString(mLocationManager.getCoordinateType()));
}
示例3: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
public void startLocation() {
TencentLocationRequest request = TencentLocationRequest.create();
request.setInterval(1000);
int errorNo = mLocationManager.requestLocationUpdates(request, this);
if (errorNo == 2) {
System.out.println("Key����ȷ�����������ã�");
}
}
示例4: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
private void startLocation() {
TencentLocationRequest request = TencentLocationRequest.create();
request.setInterval(5000);
mLocationManager.requestLocationUpdates(request, this);
mRequestParams = request.toString() + ", 坐标系="
+ DemoUtils.toString(mLocationManager.getCoordinateType());
}
示例5: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
public void startLocation(View view) {
// 创建定位请求
TencentLocationRequest request = TencentLocationRequest.create();
// 修改定位请求参数, 周期为 5000 ms
request.setInterval(5000);
// 开始定位
mLocationManager.requestLocationUpdates(request, this);
updateLocationStatus("开始定位: " + request + ", 坐标系="
+ DemoUtils.toString(mLocationManager.getCoordinateType()));
}
示例6: startLocation
import com.tencent.map.geolocation.TencentLocationRequest; //导入方法依赖的package包/类
public void startLocation(View view) {
// 创建定位请求
TencentLocationRequest request = TencentLocationRequest.create();
// 修改定位请求参数, 定位周期 3000 ms
request.setInterval(3000);
// 开始定位
mLocationManager.requestLocationUpdates(request, this);
updateLocationStatus("开始定位: " + request + ", 坐标系="
+ DemoUtils.toString(mLocationManager.getCoordinateType()));
}