LoadURL("http://www.test.com") Help !!!

davidmd

Member
Licensed User
Longtime User
Hi

Need to Load WebPage

I wrote:
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim WebView1 As WebView

under Activity create:

Activity.AddView(WebView1,0,0,100%x,100%y)
WebView1 .LoadURL("http://test.com")


On Emulator
Got paused Error
Why ?
Please Help !!!
 

davidmd

Member
Licensed User
Longtime User
Hi

I could Do it With out :
Activity.AddView(WebView1,0,0,100%x,100%y)


The Emulator was Paused over
Still Need To keep the Ratio and scale the View
How please ?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Hi David,

Itwould be useful if you give more information when asking for help, the error I got when I ran your code as is was: java.lang.runtimeException: Object should first be initialized (WebView). Did you forget to call Activity.LoadLayout? Continue?

If this is the same error you received, then you can either create a layout with the designer and use Activity.LoadLayout, or manually initialize WebView1 with

WebView1.Initialize("WebView1")

Before adding it to the activity.

The subs you will need to access the webview (OverrideURL and PageFinished) should then be created as Sub WebView1_OverrideURL etc.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
File Attached

Steve
 

Attachments

  • webview.zip
    4.8 KB · Views: 258
Upvote 0

davidmd

Member
Licensed User
Longtime User
Try it, Got Error message , any Idea ?
error.jpg



THANKS !!!!
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You must be running a different program, The error relates to a missing layout file, which the code I sent does not have.

If you turn on Include debug information under the Project menu, it will give more meaningful error messages, at least with the B4A line number.

If you post the code you are running, I'll take a look. (export as zip and attach it to the post)

Steve
 
Upvote 0

davidmd

Member
Licensed User
Longtime User
Hi Steve

OK , i could Load Now.
The page to Big..
I wish to Use Costume Zoom
+ , --

I used

DIM in as Boolean

on Click:

WebView1.Zoom(in)

It just Zoom in
Can not get out , Increase
Any Idea ?
 
Upvote 0
Top