【发布时间】:2013-09-02 08:47:49
【问题描述】:
我尝试更改从 android 2 传递到 android 4 的源代码。代码没有让我出错,应用程序启动。但一开始有一个登录。当我单击“登录”时,应用程序崩溃。 logcat 显示SimpleExpandableListAdapter 有问题。这是使用 SimpleExpandableListAdapter 的代码部分:
expListAdapter = new SimpleExpandableListAdapter(_ContactScreen_object,
_groupSections, // groupData describes the first-level entries
R.layout.group_row, // Layout for the first-level entries
new String[] { "sectionName" }, // Key in the groupData maps to
// display
new int[] { R.id.groupname }, // Data under "friendName" key
// goes into this TextView
_result, // childData describes second-level entries
R.layout.child_row, // Layout for second-level entries
new String[] { "friendName", "status" }, // Keys in childData
// maps to display
new int[] { R.id.childname, R.id.rgb } // Data under the keys
// above go into these
// TextViews
)
日志猫:
您认为问题在于代码旧吗? SimpleExpandableListAdapter的结构现在不一样了?我有什么要改变的?
【问题讨论】:
-
请发布异常堆栈跟踪。
标签: java android sdk android-listview expandablelistadapter