Android Context Get getStringResourceByName(String aString, Context context)

Here you can find the source of getStringResourceByName(String aString, Context context)

Description

get String Resource By Name

Declaration

public static int getStringResourceByName(String aString,
            Context context) 

Method Source Code

//package com.java2s;

import android.content.Context;

public class Main {
    public static int getStringResourceByName(String aString,
            Context context) {//from  w  ww  .  jav a2s.  co  m
        String packageName = context.getPackageName();
        int resId = context.getResources().getIdentifier(aString, "string",
                packageName);
        return resId;
    }
}

Related

  1. getSmiledText(Context context, CharSequence text)
  2. getSmsId(Context context)
  3. getString(Context context, String key, String defValue)
  4. getString(Context context, int resourceId)
  5. getStringFromResource(int resource, Context context)
  6. getSystemDiskCacheDir(Context context)
  7. getTCBoldFont(Context context)
  8. getTCFont(Context context)
  9. getTCItalicFont(Context context)