1
我正在創建一個hashmap,並且按照我想要在可擴展列表視圖中顯示的順序添加按鍵。下面是把字符串HashMap中的代碼:在可擴展列表視圖中按鍵的排序android
HashMap<String, List<String>> example= new HashMap<String, List<String>>();
example.put(cnt.getString(R.string.first), first_summary);
example.put(cnt.getString(R.string.second), second_summary);
example.put(cnt.getString(R.string.third), third_summary);
但是,當我加入它的ListView然後第二first.How之前來我可以在我所定義的按鍵順序expandablelistview插入?
下面是expandablelistview創建代碼:
public View getGroupView(int parent, boolean isExpanded, View convertview, ViewGroup parentview) {
// TODO Auto-generated method stub
String group_title = (String) getGroup(parent);
if(convertview == null)
{
LayoutInflater inflator = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertview = inflator.inflate(R.layout.parent_layout, parentview,false);
}
TextView parent_textview = (TextView) convertview.findViewById(R.id.parent_txt);
parent_textview.setTypeface(null, Typeface.BOLD);
parent_textview.setText(group_title);
return convertview;
}
你能引導請..