简体   繁体   English

如何在basic4android中解析json?

[英]how to parse json in basic4android?

I want to parse JSON from URL to android label in basic4android . 我想将URL中的JSON解析为basic4android中的android标签。

I try this but not working : 我尝试这样做,但不起作用:

Sub Activity_Create(FirstTime As Boolean)
Dim Label1 As Label
Dim job As HttpJob

job.Initialize("Job", Me)
job.Download("http://api.tvmaze.com/shows/82")


If job.Success = True Then

Dim parser As JSONParser
parser.Initialize(job.GetString)
Dim root As Map = parser.NextObject

Dim name As String = root.Get("name")
Label1.Text = Title
End if

您有Label1.Text = Title ,应为Label1.Text = name

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM