Java tutorial
//package com.java2s; //License from project: LGPL import android.content.Context; import java.util.HashMap; public class Main { public static HashMap<String, String> parseStringMapResource(Context ctx, int stringArrayResourceId) { String[] stringArray = ctx.getResources().getStringArray(stringArrayResourceId); HashMap<String, String> map = new HashMap<>(stringArray.length); for (String entry : stringArray) { String[] splitResult = entry.split("\\|", 2); map.put(splitResult[0], splitResult[1]); } return map; } }