Android Question Reload a same page crashed at B4XPages

AndroidMadhu

Active Member
Licensed User
Hello,
When first time I am loading a page it is running fine as expected.
But when I press the back button and again reload the page , the value at first page load is still showing and if I perform any action/Activity on the same page it is crashed.
Below is the error details :
B4X:
 Error occurred on line: 144 (actSearch)
java.lang.RuntimeException: Class instance was not initialized (b4xfloattextfield)
at anywheresoftware.b4a.debug.Debug.shouldDelegate(Debug.java:242)
at b4a.example.b4xfloattextfield._gettext(b4xfloattextfield.java:76)
at b4a.example.actsearch._btnsearch_click(actsearch.java:169)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:193)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:6614)
at android.view.View.performClickInternal(View.java:6587)
at android.view.View.access$3100(View.java:787)
at android.view.View$PerformClick.run(View.java:26122)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6820)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)

Below is the code base:
B4X:
Sub btnBookAmbulance_Click
actSearch.Initialize()
B4XPages.ShowPage("actSearch")
End Sub

 Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Log("Create Search")
'load the layout to Root
Root.LoadLayout("search")
Dim bdwOn As BitmapDrawable
bdwOn.Initialize(LoadBitmap(File.DirAssets, "icons8-search-24.png"))

Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Enabled, bdwOn)
btnSearch.Background=sld
btnSearch2.Background=sld
''''REVERSE GEOCODING FOR PRESENT LOCATION
Dim job As HttpJob
job.Initialize("SearchHome", Me)
If B4XPages.MainPage.gmap.MyLocation.Latitude>0 Then
job.Download("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/json?latlng=" & B4XPages.MainPage.gmap.MyLocation.Latitude & "," & B4XPages.MainPage.gmap.MyLocation.Longitude & "&sensor=true&key=" & B4XPages.MainPage.ApiKey)
End If
End Sub


Please advice...

Thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…