您当前的位置: Android HUD SDK > 开发指南 > 服务区
服务区

概述

当用户行驶到高速路段,导航展示的告诉服务区及距离服务区距离等信息,如下图所示:

guide_servicearea.png

关键代码

@Override
public void onServiceArea(BNRGServiceArea arg0) {
	Log.d(BNRemoteConstants.MODULE_TAG, "onServiceArea............name = " + arg0.getServiceAreaName() + ", distance = " + arg0.getServiceAreaDistance());
 
	final String serviceAreaTips = getFormatAfterMeters(arg0.getServiceAreaDistance()) + " " + arg0.getServiceAreaName();
	mMainHandler.post(new Runnable() {
 
		@Override
		public void run() {
			mNavilogTv.setText(serviceAreaTips);
		}
	});
}