Yes, How to I can to create a Close Button InAppBrowser in Android?
PDT: Why now InAppBrowser used? It was better before, because the user could choose how to open an external link
PDT: Why now InAppBrowser used? It was better before, because the user could choose how to open an external link
- 9 Posts
- 0 Reply Likes
- frustrated
Posted 6 years ago
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
If you currently don't see forward/backward/close buttons, you are not opening an inAppBrowser. If it's also not a regular browser you see, you're most likely opening an external web document in the regular Android webview.
This may be OK in Android, because users can escape from there using the back button. But on iOS, they would be stuck without possibility to return to the app's latest state.
You haven't said anything about what it is you're trying to achieve with the inAppBrowser, so it's nearly impossible to suggest improvements or solutions.
This may be OK in Android, because users can escape from there using the back button. But on iOS, they would be stuck without possibility to return to the app's latest state.
Why now InAppBrowser used? It was better beforeWell, if you think you're better off not using the inAppBrowser, then don't.
You haven't said anything about what it is you're trying to achieve with the inAppBrowser, so it's nearly impossible to suggest improvements or solutions.
- 9 Posts
- 0 Reply Likes
I'm already getting it!
My problem is this, I will try to explain it very well with the translator, I do not speak English:
For a long time there was not compiled my app. The last time I compiled (4 months ago probably) external links from my app to give click showed options to open (Internet App, Chrome App, Twitter App, etc).
Anyway, yesterday I compiled my app again and external links stopped working.
As I was figuring, I solved the problem by adding these lines to config.xml
All great, except for the following:
Now external links do not open in the browser application instead of this is displayed without leaving my app. But there is no option to close the external link, not a navigation bar is displayed.
I wish I could add a navigation bar to such external links that open in my app.
Or that users see a message that allows them to choose which app to open these links.
Thank you for your prompt reply!
PDT: I'm working on Android, I do not know what problems you may have with iOS in the future.
My problem is this, I will try to explain it very well with the translator, I do not speak English:
For a long time there was not compiled my app. The last time I compiled (4 months ago probably) external links from my app to give click showed options to open (Internet App, Chrome App, Twitter App, etc).
Anyway, yesterday I compiled my app again and external links stopped working.
As I was figuring, I solved the problem by adding these lines to config.xml
All great, except for the following:
Now external links do not open in the browser application instead of this is displayed without leaving my app. But there is no option to close the external link, not a navigation bar is displayed.
I wish I could add a navigation bar to such external links that open in my app.
Or that users see a message that allows them to choose which app to open these links.
Thank you for your prompt reply!
PDT: I'm working on Android, I do not know what problems you may have with iOS in the future.
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
OK. You want your external sites behind hyperlinks to open in one of the device browsers.
In that case, you need the inAppBrowser plugin.
[Maybe you did and maybe you wanted to show code from the config.xml. If you did, you have not wrapped it inside a CODE tag. Your code is not visible on the forum]
Include
in your config.xml
Try this in your html:
after including this in your custom script section:
For further options and usage, see https://github.com/apache/cordova-plu...
In that case, you need the inAppBrowser plugin.
[Maybe you did and maybe you wanted to show code from the config.xml. If you did, you have not wrapped it inside a CODE tag. Your code is not visible on the forum]
Include
<gap:plugin name="org.apache.cordova.inappbrowser" />
in your config.xml
Try this in your html:
<a href="http://apache.org" onClick="return inAB(this.href,'_system');">Open in Browser</a>
<a href="http://phonegap.com" onClick="return inAB(this.href,'_blank');">Open in InAppBrowser</a>
after including this in your custom script section:
function inAB(myUrl, systemOrBlank) {
window.open(myUrl,systemOrBlank,'location=yes');
return false;
}
For further options and usage, see https://github.com/apache/cordova-plu...
- 1 Post
- 0 Reply Likes
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers

