Hi i create some project with start activity from service, in my device it work as expected (activity transparent is show panel)but not work for another device (Activity always on background).
Please any advice...
B4X:
Sub Service_Start (StartingIntent As Intent)
'nb6.h
'If StartingIntent.IsInitialized Then fm.HandleIntent(StartingIntent)
'If StartingIntent.IsInitialized Then
StartServiceAt("", DateTime.Now + 5 * DateTime.TicksPerSecond, True) 'schedule the next task to run in 30 seconds.
Sleep(0)
CheckNotif
'End If
Service.StopAutomaticForeground 'Call this when the background task completes (if there is one)
End Sub
Sub CheckNotif
'POST API
'load JSON return format to string
ReadJSON
End Sub
Sub ReadJSON
If Sensor1=0 Or Sensor2=0 Or Sensor3=0 Or Sensor3=0 Or Sensor4=0 Or Sensor5=0 Or Sensor6=0 Or Sensor7=0 Or Sensor8=0 Or Sensor9=0 Or Sensor10=0 Or Sensor11=0 Or Sensor11=0 Then
StartActivity(Notif)
Else if Sensor1>0 Or Sensor2>0 Or Sensor3>0 Or Sensor3=0 Or Sensor4=0 Or Sensor5=0 Or Sensor6=0 Or Sensor7=0 Or Sensor8=0 Or Sensor9=0 Or Sensor10=0 Or Sensor11=0 Or Sensor11=0 Then
CallSub(Notif,"Button1_Click")
End If
Next
End Sub
Please any advice...
Last edited: