<?xml version="1.0" encoding="UTF-8" ?>
<menus><menu actionid="Home"><title>主页</title></menu></menus>
后台有变量actionid,用于判断执行的哪个action。 要根据actionid的值读取xml文件里的<title>标签里的内容。
求详细解答,在线等。

解决方案 »

  1.   

    不同的action难道跳转到一个action处理里面?
    至于读xml,照着改吧public Map<String, String> getProvinceMap() {
    Map<String, String> proMap = new HashMap<String, String>();
    try {
    InputStream in = DBHelper.getDBHelper().getContext().getResources()
    .getAssets().open("province.xml");
    InputStream is = IOHelper.fromInputStreamToInputStreamInCharset(in,"utf-8");
    SAXReader sr = new SAXReader();
    Document document = sr.read(is);
    Element root = document.getRootElement();
    List<?> elementlist = root.elements("city");
    for (Object obj : elementlist) {
    Element row = (Element) obj;
    String quName = row.attribute("quName").getText();
    String pyName = row.attribute("pyName").getText();
    proMap.put(quName, pyName);
    }
    } catch (Exception e) {
    Log.e("tag", "read configure error");
    }
    return proMap;
    }
      

  2.   

    回复二楼,:
      没用你这个,除登录,退出等画面没用到用户,密码的action都掉用了拦截器,我在拦截器里有方法取得执行action name。 不过你的方法还是有参考价值,谢谢。