大神们帮我看一下这是为什么

404-NtFound 2018-05-23 04:25:57
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));

}
});
...全文
775 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
bt侠 2018-05-23
  • 打赏
  • 举报
回复
mSearch这个为空,看看是否是未初始化或者对象的ID不对
zzzhehe 2018-05-23
  • 打赏
  • 举报
回复
log有值的话 那么debug看看msearch是否初始化
404-NtFound 2018-05-23
  • 打赏
  • 举报
回复
引用 3 楼 zhumj_zhumj 的回复:
143行引用了空对象
404-NtFound 2018-05-23
  • 打赏
  • 举报
回复
引用 3 楼 zhumj_zhumj 的回复:
143行引用了空对象
我能从布局xml中获取到我输入的值,但是传进去显示为空
头发还没秃a 2018-05-23
  • 打赏
  • 举报
回复
143行引用了空对象
404-NtFound 2018-05-23
  • 打赏
  • 举报
回复
2楼是我的LogCat
404-NtFound 2018-05-23
  • 打赏
  • 举报
回复

80,337

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧