another stupid question .....
I am struggling to get my code done, as a last result I tried to use the original posted example (code and XML) but I get the same error all the time :
does the example really work ?
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 33 (Main)
java.lang.ClassCastException: anywheresoftware.b4a.objects.collections.Map$MyMap cannot be cast to java.util.List
at b4a.example.main._activity_create(main.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:342)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.example.main.afterFirstLayout(main.java:102)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
** Activity (main) Resume **
Code:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
Dim xm As Xml2Map
xm.Initialize
ParsedData = xm.Parse(File.ReadString(File.DirAssets, "rss.xml"))
End If
Activity.LoadLayout("1")
ListView1.SingleLineLayout.ItemHeight = 60dip
Dim rss As Map = ParsedData.Get("rss")
Dim channel As Map = rss.Get("channel")
Dim items As List = channel.Get("item")
For Each item As Map In items ' <- this is 33
Dim title As String = item.Get("title")
Dim link As String = item.Get("link")
ListView1.AddSingleLine2(title, link)
Next
End Sub
Code:
(MyMap) {title=Phone library was updated - V1.10, link=http://www.b4x.com/forum/additional-libraries-official-updates/6859-phone-library-updated-v1-10-a.html, pubDate=Sun, 12 Dec 2010 09:27:38 GMT, guid={Attributes={isPermaLink=true}, Text=http://www.b4x.com/forum/additional-libraries-official-updates/6859-phone-library-updated-v1-10-a.html}}
help please