Android Question Change language on menubar ?

hookshy

Well-Known Member
Licensed User
Longtime User
I tried but the activity does not restart ! ??

B4X:
Dim res As Int

Select limba
Case "eng"
If schimb Then res=Msgbox2("Please restart aplication","Language","Yes","","Not now",atentie)
Case "fra"
If schimb Then res=Msgbox2("Veuillez redémarrer l'application","Langue","Oui","","Pas maintenant",atentie)
Case "ger"
If schimb Then res=Msgbox2("Va rog sa restartati aplicatia","Limba","Restart","","Nu acum",atentie)
Case "esp"
If schimb Then res=Msgbox2("Por favor, reinicie la aplicación","Idioma","Si","","Ahora no",atentie)
Case "ita"
If schimb Then res=Msgbox2("Riavvia l'applicazione", "Lingua", "Si", "", "Non ora",atentie)
Case Else
res=Msgbox2("Please restart aplication","Language","Yes","","Not now",atentie)
End Select

If res=DialogResponse.POSITIVE Then

Activity.Finish
StartActivity(Me)

End If
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've tried this code and it seems to work correctly:
B4X:
Sub Process_Globals
  Dim i As Int
End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
   Activity.AddMenuItem(i, "menu1")
End Sub

Sub Menu1_Click
   i = i + 1
   Activity.Finish
   StartActivity(Me)
End Sub

You can use a sliding menu or a "quick action" instead of the standard menu. It will be simpler to modify.
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
Ok the the code is corrent and works !! tested on other devices.

It seems I have a problem with my device motorola defy ...that lately have alot ot strange behaviour ..with all that I am still using it I will though it on the window some day . The OS on this motorola sucks.
 
Upvote 0
Top