Android Question CreateRemoteViews can only be called inside a Receiver module.

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I have opened an old project from years ago that consists of a widget that displays temperature and other data.
I was going to make some changes to the project and I have encountered this error that I don't know how to fix.
Can you tell me what to do?

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.
    
  Dim rv As RemoteViews
        
End Sub

Sub Service_Create
    
  rv = ConfigureHomeWidget("Fmain","rv",30,"widget-temp")    '  <--- Error
      
End Sub
 

vecino

Well-Known Member
Licensed User
Longtime User
Thanks, I followed your advice and replaced it with a "receiver", but now I get this error when compiling.
I do not know if it is something caused by the change made, or it is something that has nothing to do and then I better open another thread.
Thanks.

B4X:
B4ABuilder v12.80
Global Java version: 14
BaseFolder: ..
System.Exception: Multiple projects found. Please set the Project property.
   en in.l()
   en in.j(String[] A_0)
   en in.m(String[] A_0)
Multiple projects found. Please set the Project property.
Completed. Exit code: 1
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
I have done a "Clean project" and now it has compiled perfectly and everything works fine.
Thank you very much.
 
Upvote 0
Top