Ciao,
ho realizzato un app che viene aggiornata da un altra app.
Ho aggiunto nel manifest
e poi ho un service
perè quando si scatena la cosa ho un crash...
Il mio progetto usa B4XPages..non so se centra ma direi di si visto che da errore sul get mamager...
Qualche aiuto?
Grazie
ho realizzato un app che viene aggiornata da un altra app.
Ho aggiunto nel manifest
B4X:
AddReceiverText(PackageReplaced, <intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>)
B4X:
#Region Service Attributes
#StartAtBoot: False
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Log("StartingIntent : " & StartingIntent.Action)
Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
End Sub
Sub Service_Destroy
End Sub
B4X:
** Receiver (packagereplaced) OnReceive **
*** Service (starter) Create ***
** Service (starter) Start **
** Service (packagereplaced) Create **
** Service (packagereplaced) Start **
Service started in foreground mode.
StartingIntent : android.intent.action.MY_PACKAGE_REPLACED
b4xpages_getmanager (java line: 55)
java.lang.ClassCastException: java.lang.Object cannot be cast to it.becar.doctorpad.main.b4xpagesmanager
at it.becar.doctorpad.main.b4xpages._getmanager(b4xpages.java:55)
at it.becar.doctorpad.main.b4xpages._mainpage(b4xpages.java:99)
at it.becar.doctorpad.main.starter._bleoxy_stopscan(starter.java:488)
at it.becar.doctorpad.main.starter._timerscanoxy_tick(starter.java:1366)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
starter_application_error (java line: 224)
java.lang.RuntimeException: Object should first be initialized (StringBuilder).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.keywords.StringBuilderWrapper.Append(StringBuilderWrapper.java:53)
at it.becar.doctorpad.main.starter._application_error(starter.java:224)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1082)
at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1045)
at anywheresoftware.b4a.objects.ServiceHelper$StarterHelper.handleUncaughtException(ServiceHelper.java:267)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:239)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
starter_application_error (java line: 224)
java.lang.RuntimeException: Object should first be initialized (StringBuilder).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.keywords.StringBuilderWrapper.Append(StringBuilderWrapper.java:53)
at it.becar.doctorpad.main.starter._application_error(starter.java:224)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1082)
at anywheresoftware.b4a.keywords.Common.CallSubNew3(Common.java:1045)
at anywheresoftware.b4a.objects.ServiceHelper$StarterHelper.handleUncaughtException(ServiceHelper.java:267)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:239)
at anywheresoftware.b4a.objects.Timer$TickTack.run(Timer.java:105)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8107)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Qualche aiuto?
Grazie