Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Ph As Phone
Dim Pm As PackageManager
Dim Packages As List
Dim ListView1 As ListView
Dim Intent1 As Intent
Dim Icon As BitmapDrawable
Dim ImageView1 As ImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("main")
Header = Ph.GetResourceDrawable(33619990)(
ImageView1.Bitmap = Header.Bitmap
ProgressDialogShow("Создание списка пакетов")
Packages = Pm.GetInstalledPackages
For i=0 To Packages.Size - 1
'Dim Intent1 As Intent
Intent1 = Pm.GetApplicationIntent(Packages.Get(i))
If Intent1.IsInitialized Then
Try
Icon = Pm.GetApplicationIcon(Packages.Get(i))
ListView1.AddTwoLinesAndBitmap2(Pm.GetApplicationLabel(Packages.Get(i)), Packages.Get(i), Icon.Bitmap, Packages.Get(i))
Catch
ListView1.AddTwoLines(Pm.GetApplicationLabel(Packages.Get(i)), Packages.Get(i))
End Try
DoEvents
End If
Next
ProgressDialogHide
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
Intent1 = Pm.GetApplicationIntent(Value)
Icon = Activity.Background
If Intent1.IsInitialized Then
StartActivity(Intent1)
End If
End Sub