Sub Activity_Create(FirstTime As Boolean)
Try
Dim In As Intent
Dim LizMan As LizMa
Dim bd As BitmapDrawable
Dim Package As String
Dim App As String
Dim AllLabels As List
Dim Lable As String
Dim lblSet As Label
lblSet.Initialize("")
AllApps.Initialize
AllPackages.Initialize
AllLabels.Initialize
AllPackages = PM.GetInstalledPackages
If (AllPackages.Size > 0) Then
AllApps.Clear
For i = 0 To AllPackages.Size - 1
Package = AllPackages.Get(i)
In = PM.GetApplicationIntent(Package)
If (In.IsInitialized) Then
Lable = PM.GetApplicationLabel(Package).Trim
AllLabels.Add(Lable)
AllApps.Put(Lable, Package)
End If
Next
Else
Msgbox("Keine Applikationen installiert!" & CRLF & "Programm wird beendet.", "Error")
End If
Activity.LoadLayout("AppList.bal")
svList.Initialize("lstAllApps")
svList.ScrollingBackgroundColor = Colors.Transparent
svList.SingleLineLayout.ItemHeight = 100dip
svList.SingleLineLayout.Label.TextSize = 20
svList.SingleLineLayout.Label.TextColor = Colors.Blue
svList.SingleLineLayout.Label.Gravity = Gravity.CENTER
svList.FastScrollEnabled = True
If (AllLabels.Size > 0) Then
AllLabels = LizMan.sortList(AllLabels)
For i = 0 To AllLabels.Size - 1
Package = AllApps.Get(AllLabels.Get(i))
Lable = PM.GetApplicationLabel(Package)
If Package.EqualsIgnoreCase(Global.LockPackage) = True Then
App = Lable
End If
bd = PM.GetApplicationIcon(Package)
svList.AddTwoLinesAndBitmap(AllLabels.Get(i), Package, bd.Bitmap)
Next
Activity.AddView(svList, 0, 0, 100%x, 80%y)
lblSet.Text = Global.LockPackage
End If
Catch
Exceptions.RuntimeException("AppView.Activity_Create")
End Try
End Sub