Android app to launch link in existing Chrome tab

2 posts, 0 answers
  1. Andy
    Andy avatar
    3 posts
    Member since:
    May 2009

    Posted 28 May 2014 Link to this post

    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')}
    );
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 02 Jun 2014 Link to this post

    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!

     
Back to Top