This is a migrated thread and some comments may be shown as answers.

Android app to launch link in existing Chrome tab

1 Answer 171 Views
Apache Cordova
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Andy
Top achievements
Rank 1
Andy asked on 28 May 2014, 08:26 PM
I am developing a kendo mobile cordova/phonegap application using Telerik AppBuilder mainly for Android right now.  My native Android build is getting launched from a browser using a custom Android Intent and then I would like it to return focus to the browser that launched it once native processing is over.  I am able to get the native WebIntent Android Plugin for Cordova 3.X By Boris Smus to launch my web application in the Android Chrome browser but it opens a new tab each time I transfer back to my web app from the native app.  I am seeing some info on EXTRA_APPLICATION_ID and EXTRA_CREATE_NEW_TAB but I am not able to find much on how to use them. 

Does anyone know how I can launch a link in an existing tab or possibly the exact same tab that the native Android app was launched from?

Here is the javascript code I am using to launch the web link in the browser.
 window.plugins.webintent.startActivity({
     action: window.plugins.webintent.ACTION_VIEW,
     url: 'http://www.telerik.com'},
     function() {},
     function() {alert('Failed to open URL via Android Intent')}
);

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 02 Jun 2014, 02:53 PM
Hello Andrew,

As far as I know such a functionality is not supported out-of-the-box using cordova/phonegap. It seems that the Browser keys you mentioned (EXTRA_APPLICATION_ID and EXTRA_CREATE_NEW_TAB) should help in controlling whether a new tab will be opened to launch a link from an Android app, but they can only be used within a native Android application.

I don't see a way to pass these keys to the Android Browser using the WebIntent plug-in but perhaps you can contact the plugin's author to see if he or any of the contributors to the project can help.

Regards,
Tina Stancheva
Telerik
 

Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

 
Tags
Apache Cordova
Asked by
Andy
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or