Created
January 10, 2018 11:11
-
-
Save saurabharora90/cd18194eda90a2e606aee347b107e760 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Description getDescriptionsFromJson(JsonElement jsonElement){ | |
Description description = new Description(); | |
for (Map.Entry<String, JsonElement> entry :jsonElement.getAsJsonObject().entrySet()){ | |
if(entry.getKey().equalsIgnoreCase("en") || entry.getKey().equalsIgnoreCase(getDefaultLangCode())) | |
description.descriptionMap.put(entry.getKey(), entry.getValue().getAsString()); | |
} | |
return description; | |
} | |
public static String getDefaultCode(Context context){ | |
String locale = context.getResources().getConfiguration().locale.getLanguage(); | |
return locale.toLowerCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment