Android Question List.Clear error!

vecino

Well-Known Member
Licensed User
Hey, something strange.
"UnsupportedOperationException" in list.clear
I created a test project. The error is the same.

B4X:
#Region  Project Attributes
   #ApplicationLabel: B4A Example
   #VersionCode: 1
   #VersionName:
   'SupportedOrientations possible values: unspecified, landscape or portrait.
   #SupportedOrientations: unspecified
   #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
   #FullScreen: False
   #IncludeTitle: True
#End Region

Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
End Sub

Sub Globals
   Private lv1 As ListView
   Private lv2 As ListView
   Dim ll As List
End Sub

Sub Activity_Create(FirstTime As Boolean)
  Activity.LoadLayout("Fmain")
  ll.Initialize
End Sub

Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub

Sub Button1_Click
  Dim iX As Int
  lv1.Clear
  ll.Clear
  ll = File.ListFiles("/usb1")
  For iX=0 To ll.Size-1
    lv1.AddSingleLine(ll.Get(iX))
  Next    
End Sub

Sub Button2_Click
  Dim iX As Int

  lv2.Clear
  ll.Clear

  ll = File.ListFiles("/usb2")
  For iX=0 To ll.Size-1
    lv2.AddSingleLine(ll.Get(iX))
  Next
End Sub
 

Attachments

Top