Android Question WebViewHelp 2 Ask Question

nso91191

Member
Licensed User
Longtime User
I Have A Ask 2 Question

1 Ask >> i use webview and swipetorefresh

if check connection method

Internet Connection is ON
webview loaded current page

Internet Connection is OFF
webview Error Page

i want to do current page

but swipe refresh internet connection ON condition webview go to home page :( how to do current page refresh ...
B4X:
wvext.reload
( but error page is local current page ) not work :( :3

somebody help me
B4X:
if else or for each
check method how to do please a example source :(


B4X:
Sub swipe_Refresh
   If IsConnected = False Then
     wvext.loadUrl("file:///android_asset/index.htm")
     ToastMessageShow("Error: Server response,  Can't fetch show data.", True)
   Else If IsConnected = True Then
     wvext.LoadUrl("CurrentPage") << i need this line 
   End If
   wvext.Reload
   swipe.Refreshing = False
End Sub


=================================================================



2 Ask >> Activity_KeyPress

WebView Have a many page gone

i have use function webview.back it's correct

i want to know
B4X:
webview.back
( all page are back gone , last of home and then press backkey 2press application EXIT ) how to do ??

Thank You

Help Me EveryBody know that .
 

Attachments

  • webviewexamplehelp.zip
    87.7 KB · Views: 96
Last edited:

nso91191

Member
Licensed User
Longtime User
B4X:
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
   If KeyCode=KeyCodes.KEYCODE_BACK Then
     WebView1.Back   '   go to the last loaded web page in the WebView history if one exists - but how we be sure a previous page exists?
     Return True     '   returning True indicates that the event has been handled
   Else
     Return False   '   the default Back button behaviour will now be executed
   End If
End Sub

webview page back finally home page arrive finish exit application back button

don't work ?
 
Upvote 0
Top