So heres the deal: I am getting to know the functionalities of the Webivew in Android and I've been testing with some well known urls and everything works fine. I've also added the onsavedInstanceState and onBackPressed methods to make sure I can go back to the previous page and make sure the page does no reload.
Problem:
Lets say I load the Facebook url and I am posting something, The SwiftKey Dictionary does not show. Is there a way to work around this ?
Thanks in advance.
Related
I have a CodeName One app where I'm using the BrowserComponent to load an HTML page. This HTML page (HTMLPage1) further opens another HTML page (HTMLPage2) on the click of a button using window.open(). This works correctly in the app. This HTMLPage2 has a Close button and on clicking this button, HTMLPage2 should be closed and the control should go back to HTMLPage1. However, this is not working as expected. On clicking the Close button, nothing happens in the app and HTMLPage2 is still shown in the app. I have tried using window.close() and self.close() and neither of them work.
I found the following article on searching
Android Webview: Scripts may close only the windows that were opened by it that seems similar to the problem I am facing
Also, I have a WebView Test app (can be found on PlayStore - search for com.snc.test.WebView Test) on my mobile that lets me modify the WebView settings and launch different URL's. I used this app to check if I can successfully invoke my HTML pages through the WebView Test app. With the default settings, I ran into the same problem as described above. The Close button didn't work.
However, then I modified the setSupportMultipleWindows() property in the app and set it to true. After that, it worked correctly through the WebView Test app. On clicking Close in HTMLPage2, that page was closed and I could see HTMLPage1 again.
So, I tried checking how to set this property in CodeName One. I found that the BrowserComponent.setProperty("SupportMultipleWindows", "true") should be able to do the same thing. When I set this property and tested the app, it still didn't work.
Then I looked through the documentation of
WebSettings.setSupportMultipleWindows
According to this documentation, if set to true, WebChromeClient.onCreateWindow(WebView, boolean, boolean, Message) must be implemented by the host application.
I could not find a way to do this through CodeName One.
Am I going down the right path to tackle this problem? If not, kindly guide me.
I am getting a behavior which I am not sure of how to explain. An application has a deep link with a custom scheme data block in the activity's intent filter. A link click in a web page is responsible for delivering the intent.
Now, this works as intended but only the first time!
Specifically in Android 7 and 8 (older versions seem fine) after the first time the link is clicked instead of the app activity showing, a link of the format scheme://host/file.html?url=[link to asp file containing the intent function] is loaded with the header and footer of the web page but no contents (nothing there anyway). If the page is refreshed (button or transition back to it from another page) the link works properly but only once. Need to refresh each time it has been used for it to work again.
I tested the behavior with multiple browsers and it seems to be the same. I am guessing it has something to do with a behavior change in the newer versions of Android (???) but I cannot seem to find what is causing it and whether it is an app (hard), system (probably) or browser (could be?) related issue and as a result a possible solution.
If you think there is any information that might help let me know and I will try to provide it.
Thank you.
I'm trying to implement Chrome Custom Tabs but in my small example, everytime I launch a URL it asks me with which browser I'd like to open it.
I've seen some apps like Twitter official app where the Custom Tab opens without asking anything to the user. How can I achieve that?
Thanks in advance
EDIT:
I've followed this tutorial, so my code is 99% the same and the issue is the same in both codes.
I´ve solved the issue. I was launching the URL inside a RecyclerView when a CardView was clicked.
The problem is I was warming up the tab at the same time I was launching it. After changing that, everything worked fine.
I'm working on a Phonegap/jQuery Mobile Android app.
A particular piece of content involves displaying a page which is on our server. We have used an IFrame to display this, all works fine apart from the back button. If you click through a couple of pages within the IFrame and press the phone's back button the app goes back a page rather than the content within the iframe, which is an issue.
I'm guessing it would be really tricky to get around this, but does anyone have ideas or alternate methods of displaying a external site with back button use?
Probably you need to override the default onBack method, and provide your own.
You need to figure out how to simulate going back within the iFrame programmatically
Hey everyone,
I'm working an app that includes a webbrowser inside.
I've done quite some progress with getting the webview widget to work as necessary, but this thing really puzzles me.
I can't get the webview to forget my google account, even with deleting cache and history, it still remembers it. Which is really annoying since the application will be used by many users on a single device.
Any help very much appreciated
You need to clear cookies too. Use CookieManager to remove all cookies. For example, you can add this to your onDestroy():
CookieManager.getInstance().removeAllCookie();
On top of clearing the cache and history locally, you could just loadUrl for:
https://www.google.com/accounts/Logout
This should make sure the session is ended on Google's end.
Seems like a logical solution to me.