diff --git a/app/src/main/java/com/example/notifyservice/MainActivity.java b/app/src/main/java/com/example/notifyservice/MainActivity.java index 65d55a5..a3bce49 100644 --- a/app/src/main/java/com/example/notifyservice/MainActivity.java +++ b/app/src/main/java/com/example/notifyservice/MainActivity.java @@ -448,9 +448,13 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba } else if (result.get("name"). // STATIC equals("languages")) { // STATIC + String currentLanguage = Locale.getDefault().getLanguage(); + if(!result.getJSONObject("data").has(currentLanguage)) + currentLanguage = "en"; language = result.getJSONObject( "data" // STATIC - ).getJSONObject(Locale.getDefault().getLanguage()); + ).getJSONObject(currentLanguage); + requestsCount += 1; } if (requestsCount == 2) { @@ -578,8 +582,8 @@ public class MainActivity extends AppCompatActivity implements PostRequestCallba phoneNumbers.add(new PhoneNumber( phoneNumber, telephonyManager, - telephonyManager.getSimOperatorName(), - currentCard.getCountryIso() + telephonyManager.getSimOperatorName().toLowerCase(), + currentCard.getCountryIso().toLowerCase() )); } /*