大神们帮我看一下这是为什么
transitBt.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
EditText editSt = (EditText) findViewById(R.id.start);
EditText editEn = (EditText) findViewById(R.id.end);
PlanNode stNode = PlanNode.withCityNameAndPlaceName("西安", editSt.getText().toString().trim());
PlanNode enNode = PlanNode.withCityNameAndPlaceName("西安", editEn.getText().toString().trim());
String st = stNode.getName();
String en=enNode.getName();
Log.i("Click", st);
Log.i("OnClick", en);
mSearch.transitSearch((new TransitRoutePlanOption())
.from(stNode)
.city("西安")
.to(enNode));
nowSearchType = 2;
LatLng nodeLocation = null;
String nodeTitle = null;
Object step = route.getAllStep().get(nodeIndex);
if (step instanceof DrivingRouteLine.DrivingStep) {
nodeLocation = ((DrivingRouteLine.DrivingStep) step).getEntrance().getLocation();
nodeTitle = ((DrivingRouteLine.DrivingStep) step).getInstructions();
/**
* public static class WalkingRouteLine.WalkingStep extends RouteStep
* 描述一个步行路段
* */
} else if (step instanceof WalkingRouteLine.WalkingStep) {
nodeLocation = ((WalkingRouteLine.WalkingStep) step).getEntrance().getLocation();
nodeTitle = ((WalkingRouteLine.WalkingStep) step).getInstructions();
/**
* public static class TransitRouteLine.TransitStep extends RouteStep
* 表示一个换乘路段
* */
} else if (step instanceof TransitRouteLine.TransitStep) {
nodeLocation = ((TransitRouteLine.TransitStep) step).getEntrance().getLocation();
nodeTitle = ((TransitRouteLine.TransitStep) step).getInstructions();
}
if (nodeLocation == null || nodeTitle == null) {
return;
}
//移动节点至中心
mBaiduMap.setMapStatus(MapStatusUpdateFactory.newLatLng(nodeLocation));
//显示弹出窗口
popupText = new TextView(MainActivity.this);
popupText.setBackgroundResource(R.drawable.popup);
popupText.setTextColor(0xFF000000);
popupText.setText(nodeTitle);
mBaiduMap.showInfoWindow(new InfoWindow(popupText, nodeLocation, 0));
}
});