I use Page1 for webview in my project. There are some pdf files at the web site. They are opened on Page1 too. I want that pdf files are opened at Page2. How can I provide pdf files open at Page2?
Here are the codes. What should I write at the dotted line? Or some other ways?
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
NavControl.ShowPage(Page2)
.......................................................
Return True
Else
Return False
End If
End Sub
1. Please use [code]code here...[/code] tags when posting code.
2. It is difficult to help if you make duplicate posts.
A simple way to show the pdf on the second page is to add a WebView to the second page and load the pdf url to that WebView:
B4X:
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
NavControl.ShowPage(Page2)
WebViewThatBelongsToPage2.LoadUrl(Url)
Return True
Else
Return False
End If
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.