Android Question New Starter service


Active Member
Licensed User
I´m using the new Starter service to inicialize all common stuff including language transalator.
At the first time I ask the the language and then I call "activity.Finish" to end the program so the next time the language comes.
But when I call the program again it doesn´t execute the "Starter" again .

Bellow is the log

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Primeira vez solicitar lingua
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
main_activity_create (java line: 386)
java.lang.RuntimeException: Object should first be initialized (Map).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(
at anywheresoftware.b4a.objects.collections.Map.ContainsKey(
at de.amberhome.locale.AHTranslator.GetText(
at hsp.sos.main._activity_create(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(
at anywheresoftware.b4a.BA.raiseEvent2(
at hsp.sos.main.afterFirstLayout(
at hsp.sos.main.access$000(
at hsp.sos.main$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(
After "Primeira vez solicitar lingua"

Do I must call "Starter" by code ?

Rick A.

Licensed User
That's how it works. The service is started and keeps there all the time until being finished by your code ( StopService(Starter) ) or some probably very rare system event. You should notice that the service does not have a "FirstTime" parameter, it's because the Starter.Service_Start should occur just once for the entire app lifecicle. Set your Process_Globals values as necessary, and maintain your machine states as you intend after the start between its activities.
Last edited:


Staff member
Licensed User
The process was not killed so the starter service doesn't need to be created and started again.

Where is the AHTranslator object declared?


Active Member
Licensed User
The object AHTranslator is declared in "Starter" but at the first time I didn´t initiaze it because I don´t know the language yet.

How can I finish the apk so the next time execute the "Starter" ?

I ended with "Activity.Finish" but it just "Pause" the apk.


Active Member
Licensed User
Instead of initialize the things in a "Service_Create" I do it in a function, so at the first time I will ask the language to the user and then I call that function , and the next time the software starts I call it in "Service_Create" .