Hi,
When i close the Service, it continue to start at volume key press.
In my app, when i close the Service I write:
Main
the DestroyApp is a global boolean declared into Main and assigned to value True into Service.
The App are closed but, when i press a volume up or down... the Service create and Start Again
Why?
This is the Log when Start after close the service and press a volume key, into Service:
This is a LOG
The Debug it's closed and the App finish but... when I click a volume key... it's Start again
When i close the Service, it continue to start at volume key press.
In my app, when i close the Service I write:
Main
B4X:
Sub Activity_Create(FirstTime As Boolean)
If DestroyApp=True Then
CancelScheduledService(srvPickUp)
StopService(srvPickUp)
Activity.CloseMenu
Activity.RemoveAllViews
Activity.Finish
ExitApplication
Else
Activity.Finish
End If
End Sub
the DestroyApp is a global boolean declared into Main and assigned to value True into Service.
The App are closed but, when i press a volume up or down... the Service create and Start Again
Why?
This is the Log when Start after close the service and press a volume key, into Service:
B4X:
Sub Service_Start (StartingIntent As Intent)
Dim curVol As Int
If StartingIntent.HasExtra("android.media.EXTRA_VOLUME_STREAM_VALUE") Then
curVol = StartingIntent.GetExtra("android.media.EXTRA_VOLUME_STREAM_VALUE")
Log("Service_Start: Volume")
...
...
...
This is a LOG
B4X:
** Service (srvpickup) Start **
** Activity (menu) Create, isFirst = true **
** Activity (menu) Resume **
** Service (srvpickup) Start **
Service_Start: Volume
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Activity (menu) Pause, UserClosed = true **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Activity (main) Create, isFirst = true **
Main: End
The Debug it's closed and the App finish but... when I click a volume key... it's Start again
B4X:
** Service (srvpickup) Create **
** Service (srvpickup) Start **
Service_Start: Volume
** Service (srvpickup) Start **
Service_Start: Volume
** Service (srvpickup) Start **Service_Start: Volume
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
** Service (srvpickup) Start **
Last edited: