Android Question problem with poststring

farest

New Member
my code generate this error when i click button

** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Activity (jadid) Create, isFirst = true **
** Activity (jadid) Resume **
java.lang.RuntimeException: java.lang.NullPointerException
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1181)
at anywheresoftware.b4a.keywords.Common$12.run(Common.java:1192)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:853)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1147)
... 10 more

my code is here:
#Region  Project Attributes
    #ApplicationLabel: vvvvv
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

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

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private xui As XUI
    Dim htsabt As HttpJob
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'Private Hsv1 As HorizontalScrollView
    'Dim jo As JavaObject

    'Dim anim As Animation
    
    Private lblsabt As Label
    Private Panel1 As Panel
    Private pnlsaye As Panel
    Private txtesm As EditText
    Private txttel As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)

    Activity.LoadLayout("sabtnam")

    htsabt.Initialize("sabt",Me)

    
End Sub
public Sub jobdone(job As HttpJob)
    If job.Success=True Then

    Else
        
        Log("Error: " & job.ErrorMessage)
        ToastMessageShow("خطا در برقرای اتصال",False)
    End If

End Sub
Private Sub lblsabt_Click
    Dim send As String
    send = "esm="&txtesm.Text&"&tel="&txttel.Text
    htsabt.PostString("http://shabhayeroshan.ir/sabtuser.php",send)
    lblsabt.Color=xui.Color_Cyan
    StartActivity(jadid)
    
    
End Sub
 

drgottjr

Expert
Licensed User
Longtime User
exception seems to occur in jadid. what's the code look like there?
 
Upvote 0

farest

New Member
exception seems to occur in jadid. what's the code look like there?
jadid:
#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
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    ' Activity.LoadLayout("lytMain")
    Activity.LoadLayout("22")

End Sub
 
Upvote 0
Top