|
|
@@ -3,6 +3,7 @@
|
|
|
*/
|
|
|
package kr.co.zumo.app.lifeplus.util;
|
|
|
|
|
|
+import android.support.annotation.ArrayRes;
|
|
|
import android.support.annotation.IdRes;
|
|
|
import android.support.annotation.StringRes;
|
|
|
|
|
|
@@ -44,14 +45,24 @@ public class ResourceUtil {
|
|
|
/**
|
|
|
* string resId 로 text 가져오기
|
|
|
*
|
|
|
- * @param resId R.string.name
|
|
|
+ * @param resId R.string.name
|
|
|
* @param formatArgs The format arguments that will be used for
|
|
|
* substitution.
|
|
|
* @return The string data associated with the resource, formatted and
|
|
|
- * stripped of styled text information.
|
|
|
+ * stripped of styled text information.
|
|
|
*/
|
|
|
public static String getString(@StringRes int resId, Object... formatArgs) {
|
|
|
return App.getInstance().getContext().getString(resId, formatArgs);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * array 가져오기
|
|
|
+ *
|
|
|
+ * @param idName "mobile_company"
|
|
|
+ * @return ["1", "2", ...]
|
|
|
+ */
|
|
|
+ public static String[] getStringArray(String idName) {
|
|
|
+ @ArrayRes int resId = App.getInstance().getContext().getResources().getIdentifier(idName, "array", App.getInstance().getPackageName());
|
|
|
+ return App.getInstance().getResources().getStringArray(resId);
|
|
|
+ }
|
|
|
}
|