Back to project page SimpleReader.
The source code is released under:
Apache License
If you think the Android project SimpleReader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dreamteam.app.utils; //from www . ja v a 2 s. c o m import com.dreateam.app.ui.R; import android.content.Context; /** * @description TODO * @author zcloud * @date 2014?1?27? */ public class CategoryNameExchange { private String[] cates_zh; private String[] cates_en; public CategoryNameExchange(Context context) { cates_zh = context.getResources() .getStringArray(R.array.feed_category); cates_en = context.getResources() .getStringArray(R.array.feed_category_en); } public String zh2en(String zh) { for(int i = 0; i < cates_zh.length; i++) { if(zh.equals(cates_zh[i])) return cates_en[i]; } return null; } public String en2zh(String en) { for(int i = 0; i < cates_en.length; i++) { if(en.equals(cates_en[i])) return cates_zh[i]; } return null; } }