package org.commcare.utils;

import android.content.Context;

import org.commcare.util.ArrayDataSource;

/**
 * ArrayDataSource that uses the Android 'values' resources
 */

public class AndroidArrayDataSource implements ArrayDataSource {

    private Context context;

    public AndroidArrayDataSource(Context context){
        this.context = context;
    }

    @Override
    public String[] getArray(String key) {
        int resourceId = context.getResources().getIdentifier(key, "array", context.getPackageName());
        return context.getResources().getStringArray(resourceId);
    }
}

@@ -514,16 +514,151 @@
 ame());%0A
+%0A        if (resourceId == 0) %7B%0A            throw new RuntimeException(%22Localized array data for '%22 + key + %22' not found%22);%0A        %7D%0A%0A
         

Add error handling for missing resource