Android Question Change ApplicationLabel

roncoa

Member
Licensed User
Longtime User
How can I change the ApplicationLabel depending on the language?
Hello, thank you.
 

socialnetis

Active Member
Licensed User
Longtime User
Do you mean the Activity title?
You can detect the Language with this code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
  Log(GetDefaultLanguage)
End Sub

Sub GetDefaultLanguage As String
  Dim r As Reflector
  r.Target = r.RunStaticMethod("java.util.Locale", "getDefault", Null, Null)
  Return r.RunMethod("getLanguagee")
End Sub

You will need the Relfection library. You can detect the language and so put whatever you want in the Label
 
Upvote 0

udg

Expert
Licensed User
Longtime User
Did you read my post in the Italian forum?
Anyway, check this response from Erel and then follow the link in the post below it

udg
 
Upvote 0
Top