﻿B4A=true
Group=Class
ModulesStructureVersion=1
Type=Service
Version=9.9
@EndOfDesignText@
#Region  Service Attributes 
	#StartAtBoot: False
	#ExcludeFromLibrary: True
#End Region

Sub Process_Globals
	
	Public Provider As FileProvider
	Public mpLan As List
 
End Sub

Sub Service_Create
  
	Provider.Initialize
        
	Dim parser As JSONParser
	parser.Initialize(File.ReadString(File.DirAssets,"lang.json"))
	mpLan = parser.NextArray
  
End Sub
 
Sub Service_Start (StartingIntent As Intent)
	Service.StopAutomaticForeground 
End Sub

Sub Service_TaskRemoved
	finishAll
End Sub

Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
	Return True
End Sub
   

Sub Service_Destroy
 	finishAll
End Sub

Sub finishAll
  	
	Try
		
		func.cacelNotific(10)
 
		func.savePFM("psbook",1)
		func.savePFM("psspeech",1)
		func.savePFM("psquran",1)
		func.savePFM("psqus",1)
		func.savePFM("psmatn",1)
		func.savePFM("psdoaa",1)
		func.savePFM("psahkam",1)
		func.savePFM("psDS",1)
		
		StopService(myService) 
		StopService(playServiceBook) 
 	
	Catch
		Log(LastException)
	End Try

End Sub
