Sub UpdateAppsList
If Thread_Get_Data.IsInitialized = False Then
Thread_Get_Data.Initialise("Thread_Get_Data")
End If
If Lock_apps.IsInitialized = False Then
Lock_apps.Initialize(True)
End If
Dim msg As String = "Loading Apps ..."
ProgressDialogShow2(msg,False)
Dim args(0) As Object
Thread_Get_Data.Join(0)
Thread_Get_Data.Name = "Thread_1"
Thread_Get_Data.Start(Me, "Thread_Load_Data", args)
End Sub
Sub Thread_Load_Data
Lock_apps.Lock
Dim list As List = pm.GetInstalledPackages
Do Until Lock_apps.LockState = False
For i = 0 To list.Size-1
Dim package As String = list.Get(i)
Dim title As String = pm.GetApplicationLabel(package)
Next
Lock_apps.Unlock
Loop
End Sub
Sub Thread_Get_Data_Ended(fail As Boolean, error As String) 'An error or Exception has occurred in the Thread
If fail = False Then
Log("error: " & error)
ToastMessageShow("error: " & error, False)
ProgressDialogHide
Return
End If
ProgressDialogHide
Dim msg As String = "Apps list has been updated"
ToastMessageShow(msg, False)
End Sub