Java tutorial
//package com.java2s; import android.app.Activity; import android.content.Context; import android.view.View; public class Main { public static void setViewTag(View v, Activity activity, int sourceId) { v.setTag(activity.getResources().getStringArray(sourceId)); } public static void setViewTag(View v, Context context, int sourceId) { v.setTag(context.getResources().getStringArray(sourceId)); } }