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.
Related
I have a page which contains some checkbox to mark as voting purpose. When opening this page using chrome and voting and after reopening its showing the correct state of checkbox mark . But when doing same thing using android webview its not working.
Can any one help regarding this.
I have already added code for cookiemanager.setAcceptCookie(true) and also cookieManager.setAcceptThirdPartyCookies(webview , true) but its not working.
Also after reopening in android webview and clicking on other component and coming back the change is reflecting.
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.
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.
I would think this would be one of the simpler and popular app questions on the net, but I have been unable to find any info…
I would like to create an icon that when clicked would launch to my website which has been modified for mobile devices. I would like to make this available on the android market.
Does anyone know how to do this or know where I can find a step by step guide?
Matt
Have you thought of using the WebView control? Then your UI can be a local HTML with an image button and you configure it with an onclick event that refresh the WebView control with your target website?
I need to make an android App that when the user navigates to my webpage with the browser and clicks on a specific link my App activity gets launched.
I try to achieve this using Intent filters but without success. I followed some samples like Notepad and PhotoStream but nothing works for me.
The question is answered in detail at
Launch custom android application from android browser
Hope it solves your problem.
Thanks,
-A