Android Question Interval mus be larget than 0 in bootstart Service

Luis Felipe Andrade

Member
Licensed User
Hello, after the update to version 12.80, I wanted to compile some projects that by their nature must start when the computer starts (tvbox) but now no project starts automatically when the device starts, indicating that the application has stopped, I have done the debug of the app when the device starts and it only tells me "interval mus larger than 0" the service only executes the Main but it still does not start, I have already removed almost all of the Activity_manager code from main but it still does not reach that part,

It seems that the error is in the staratboot file, but I can't see the reason. I have already removed all permissions from Manifes The apps have always worked well, please help.
booter:
#Region  Service Attributes
#StartAtBoot: True
    #ExcludeFromLibrary: True
#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
    'This is the program entry point.
    'This is a good place to load resources that are not specific to a single activity.
    
End Sub

Sub Service_Start (StartingIntent As Intent)

    
'    Service.StopAutomaticForeground 'Starter service can start in the foreground state in some edge cases.
        StartActivity(Main)
End Sub

Sub Service_TaskRemoved
    'This event will be raised when the user removes the app from the recent apps list.
End Sub

'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    Return True
End Sub

Sub Service_Destroy

End Sub
Sub tmrStart_Tick

 
End Sub
 

Attachments

  • 1A.jpg
    1A.jpg
    122.4 KB · Views: 70
  • 1B.jpg
    1B.jpg
    156.2 KB · Views: 72

JohnC

Expert
Licensed User
Longtime User
Somewhere in your code you are trying to enable a timer that has not been initialized yet.

The service code you provided has a timer_tick sub in it, but you have no timers declared in this service.

So, do you have a timer declared in the Main activity?

If so, find out why you are not initializing it properly.
 
Upvote 0

Luis Felipe Andrade

Member
Licensed User
Thank You Johnc, Thanks for answering, in fact I removed the timer thinking that for some reason it was causing the error (according to Erel's sugestion about wait for services)but not even like that, if I make a new project in fact it starts when starting the device, it seems that with the previous projects something happens, I am even making a new project again, I copied the code, the layout and the files and there it works! The thing is, I think it's not the right thing to do.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
It sounds like something in the project got corrupted.

If it works in the new project, then I guess just use the new project.
 
Upvote 0
Top