我会在主/详细模式中修改 eclipse 生成的项目。我找不到办法做到这一点。特别是我会从 xml (res/values/arrays) 资源文件中获取项目。
这是java文件:
package com.ga.termeapp.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class DummyContent {
public static class DummyItem {
public String id;
public String content;
public DummyItem(String id, String content) {
this.id = id;
this.content = content;
}
@Override
public String toString() {
return content;
}
}
public static List<DummyItem> ITEMS = new ArrayList<DummyItem>();
public static Map<String, DummyItem> ITEM_MAP = new HashMap<String, DummyItem>();
static {
addItem(new DummyItem("1", "Le terme"));
addItem(new DummyItem("2", "Le cure termali"));
addItem(new DummyItem("3", ""));
}
private static void addItem(DummyItem item) {
ITEMS.add(item);
ITEM_MAP.put(item.id, item);
}
}