OK I have been trying this for about an hour and cannot see what I am doing that is different to any of the examples that I have looked at on this forum.
The following code crashes:
It is the app.Icon = bit that fails and I get the error message java.lang.NullPointerException: expected receiver of type anywheresoftware.b4a.AbsObjectWrapper, but got null
app.Icon is a part of the following type:
Would really appreciate any assistance.
Thanks
The following code crashes:
B4X:
Dim pm As PackageManager
Dim packageList As List = pm.GetInstalledPackages
For i = 0 To packageList.Size - 1
Dim packageName As String = packageList.Get(i)
Dim appIntent As Intent
appIntent = pm.GetApplicationIntent(packageName)
If appIntent.IsInitialized Then
Dim app As Application
app.packageName = packageName
app.ApplicationName=pm.GetApplicationLabel(packageName)
app.Icon = pm.GetApplicationIcon(packageName)
appList.Add(app)
End If
Next
It is the app.Icon = bit that fails and I get the error message java.lang.NullPointerException: expected receiver of type anywheresoftware.b4a.AbsObjectWrapper, but got null
app.Icon is a part of the following type:
B4X:
Type Application (PackageName As String, ApplicationName As String, Icon As BitmapDrawable)
Would really appreciate any assistance.
Thanks