Initial commit
This commit is contained in:
commit
ac2e3937ce
17 changed files with 2252 additions and 0 deletions
19
integrations/java/pl/jakubweg/Helper.java
Normal file
19
integrations/java/pl/jakubweg/Helper.java
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package pl.jakubweg;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.util.Log;
|
||||
|
||||
public class Helper {
|
||||
|
||||
public static String getStringByName(Context context, String name) {
|
||||
try {
|
||||
Resources res = context.getResources();
|
||||
return res.getString(res.getIdentifier(name, "string", context.getPackageName()));
|
||||
} catch (Throwable exception) {
|
||||
Log.e("XGlobals", "Resource not found.", exception);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue