Android Question Loading webpage in Webview

nobbi59

Active Member
Licensed User
Longtime User
Hi,

I'm trying to load a webpage in a Webview. Some days before, it worked, but now its not working but I cannot find any mistake in my code. I hope somebody here can help me.

I've checked my connection etc. When I try to get the URL from the PageFinished Event, it returns nothing.

Heres my code: (I removed my domain with ...)

B4X:
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.

    Dim btn_cancel As Button
    Dim btn_reg As Button
    Dim cb1 As RadioButton
    Dim Label2 As Label
    Dim txt_1 As EditText
    Dim txt_2 As EditText
    Dim txt_3 As EditText
    Dim Label1 As Label
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("Layout1")
    Activity.LoadLayout("start")
   
   
    txt_1.Color=Colors.White
    txt_2Color=Colors.White
    txt_3.Color=Colors.White
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub btn_reg_Click
    If cb1.Checked=True Then
   
    Dim regwv As WebView
    regwv.Initialize("regwv")
    regwv.LoadUrl(".../create.php?name="&txt_1.Text&"&data="&txt_2.Text)
   
    Else
    ToastMessageShow("Failed",False)
    End If
End Sub
Sub btn_cancel_Click
    StartActivity(Main)
End Sub
Sub regwv_PageFinished (Url As String)
    Log("url:"&Url)
    StartActivity(Main)
End Sub

I hope somebody of you can help me, I'm trying this sh*t since nearly two days :(
 

Tayfur

Well-Known Member
Licensed User
Longtime User
Hi,

I'm trying to load a webpage in a Webview. Some days before, it worked, but now its not working but I cannot find any mistake in my code. I hope somebody here can help me.

I've checked my connection etc. When I try to get the URL from the PageFinished Event, it returns nothing.

Heres my code: (I removed my domain with ...)

B4X:
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.

    Dim btn_cancel As Button
    Dim btn_reg As Button
    Dim cb1 As RadioButton
    Dim Label2 As Label
    Dim txt_1 As EditText
    Dim txt_2 As EditText
    Dim txt_3 As EditText
    Dim Label1 As Label
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("Layout1")
    Activity.LoadLayout("start")


    txt_1.Color=Colors.White
    txt_2Color=Colors.White
    txt_3.Color=Colors.White
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub



Sub btn_reg_Click
    If cb1.Checked=True Then

    Dim regwv As WebView
    regwv.Initialize("regwv")
    regwv.LoadUrl(".../create.php?name="&txt_1.Text&"&data="&txt_2.Text)

    Else
    ToastMessageShow("Failed",False)
    End If
End Sub
Sub btn_cancel_Click
    StartActivity(Main)
End Sub
Sub regwv_PageFinished (Url As String)
    Log("url:"&Url)
    StartActivity(Main)
End Sub

I hope somebody of you can help me, I'm trying this sh*t since nearly two days :(


First step check it
B4X:
 Activity.addview(regwv,left, top,width , hegith)
' or cheked  in Layout.

After...test std web page , Example : www.google.com

After check own site..

did you recive BLANK WHITE SCREEN in webview?
I was some problem. if yes, I was solve problem.
check Web view overirude event.
 
Last edited:
Upvote 0
Top