public void onItemClick(AdapterView<?> parentAdapter, View view, int position,
long id) {
TextView clickedView = (TextView) view;
/* Line 79 */ String selectedRouteName = (String) parentAdapter.getItemAtPosition(position);
String temp = selectedRouteName.substring(0, 2);
显示的错误是:
02-18 01:56:53.676: E/AndroidRuntime(821): java.lang.ClassCastException: java.util.HashMap cannot be cast to java.lang.String
02-18 01:56:53.676: E/AndroidRuntime(821): at com.coltonnicotera.londontransitguide.SchedulesActivity$1.onItemClick(SchedulesActivity.java:79)
不知道是什么原因造成的,我发现java.lang.String 无法转换为 java.util.HashMap 异常,看来我做的一切都是正确的。