Hi!
Im' trying to write a small translation-library so that devs can use the "Standard" - Translation of Android (via the strings.xml in the folder values).
I'm using this function:
If the ressource string is not found in the strings.xml files, the function should return the NoTransFound -String. Instead, it shows me the attached error-message..
Is there a way to catch the error?
Thank you!
Im' trying to write a small translation-library so that devs can use the "Standard" - Translation of Android (via the strings.xml in the folder values).
I'm using this function:
B4X:
Sub GetResourceString(Key As String) As String
Dim r As Reflector
Dim package As String
Dim id As Int
Try
package = r.GetStaticField("anywheresoftware.b4a.BA", "packageName")
id = r.GetStaticField(package & ".R$string", Key)
r.Target = r.GetContext
r.Target = r.RunMethod("getResources")
Return r.RunMethod2("getText", id, "java.lang.int")
Catch
ToastMessageShow (NoTransFound & Key,True)
Return NoTransFound
End Try
End Sub
If the ressource string is not found in the strings.xml files, the function should return the NoTransFound -String. Instead, it shows me the attached error-message..
Is there a way to catch the error?
Thank you!