#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private edtTitle As EditText
Private edtText As EditText
Dim adder As HttpJob
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("insertFrm")
adder.Initialize("adder",Me)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub btnAdd_Click
adder.PostString("http://www.alisz.ir/test/insert.php","title=" & edtTitle.Text & "&text=" & edtText.Text )
End Sub
Sub JobDone(job1 As HttpJob)
If job1.Success Then
If job1.JobName = "adder" Then
Msgbox("اطلاعات اضافه شد","")
End If
End If
End Sub
کد صفحه show:
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Private Panel1 As Panel
Private Label1 As Label
Private Label2 As Label
Private sv As ScrollView
Dim downloader As HttpJob
Dim top As Int = 0
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("sv")
downloader.Initialize("dl",Me)
downloader.Download("http://www.alisz.ir/test/show.php")
'downloader.PostString("http://www.taakapps.com/amoozesh/show.php","group="&Main.pos)
End Sub
Sub JobDone(job1 As HttpJob)
If job1.Success Then
If job1.JobName = "dl" Then
Dim parser As JSONParser
parser.Initialize(job1.GetString)
Dim lst As List
lst.Initialize
lst = parser.NextArray
For Each m As Map In lst
Dim p As Panel
p.Initialize("p")
p.Tag = m.Get("text")
sv.Panel.AddView(p,0,top,100%x,100%y)
top = top + 140dip
p.LoadLayout("show")
Dim dl As ImageDller
dl.Initialize
Label1.Text= m.Get("title")
Label2.Text = m.Get("text")
Next
sv.Panel.Height = top
End If
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
سوال
cloner01001 38
من آموزش ارسال اطلاعات و فایل به دیتابیس رو خریدم ، تا قسمت insert درست کار میکرد ولی وقتی صفحه show رو اضافه کردم ارور زیر رو داد:
B4A version: 6.80 Parsing code. (0.00s) Compiling code. (0.38s) Compiling layouts code. (0.05s) Organizing libraries. (4.58s) Generating R file. (1.20s) Compiling generated Java code. Error B4A line: 41 Msgbox(\ javac 1.6.0_04 src\b4a\example124222\insert.java:386: cannot find symbol symbol : method ObjectToCharSequence(java.lang.String) location: class anywheresoftware.b4a.BA anywheresoftware.b4a.keywords.Common.Msgbox(BA.ObjectToCharSequence("اطلاعات اضافه شد"),BA.ObjectToCharSequence(""),mostCurrent.activityBA);
کد صفحه insert:
#Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals End Sub Sub Globals Private edtTitle As EditText Private edtText As EditText Dim adder As HttpJob End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("insertFrm") adder.Initialize("adder",Me) End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub Sub btnAdd_Click adder.PostString("http://www.alisz.ir/test/insert.php","title=" & edtTitle.Text & "&text=" & edtText.Text ) End Sub Sub JobDone(job1 As HttpJob) If job1.Success Then If job1.JobName = "adder" Then Msgbox("اطلاعات اضافه شد","") End If End If End Sub
کد صفحه show:
#Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals End Sub Sub Globals Private Panel1 As Panel Private Label1 As Label Private Label2 As Label Private sv As ScrollView Dim downloader As HttpJob Dim top As Int = 0 End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("sv") downloader.Initialize("dl",Me) downloader.Download("http://www.alisz.ir/test/show.php") 'downloader.PostString("http://www.taakapps.com/amoozesh/show.php","group="&Main.pos) End Sub Sub JobDone(job1 As HttpJob) If job1.Success Then If job1.JobName = "dl" Then Dim parser As JSONParser parser.Initialize(job1.GetString) Dim lst As List lst.Initialize lst = parser.NextArray For Each m As Map In lst Dim p As Panel p.Initialize("p") p.Tag = m.Get("text") sv.Panel.AddView(p,0,top,100%x,100%y) top = top + 140dip p.LoadLayout("show") Dim dl As ImageDller dl.Initialize Label1.Text= m.Get("title") Label2.Text = m.Get("text") Next sv.Panel.Height = top End If End If End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر
1 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.