开发者

How to close a childbrowser in Phonegap build application of Android

I have built an Android application using PhoneGap and for tweeting I have used the ChildBrowser Plugin and now when I hit my tweet button I am able to tweet my post. Now the problem is after that the twitter mobile website gets open and I'm unable to go back to my application.

What I want is as soon as I post, I should get a back button on the childbrowser onclicking which childbrowser gets closed and i get redirected to my application....

I have used this function

window.plugins.childBrowser.showWebPage('开发者_StackOverflowhttp://twitter.com/home?status=\'abcdefg\'');


window.plugins.childBrowser.onLocationChange=TwitterLocationChanged;
window.plugins.childBrowser.onClose=TwitterClosed;
window.plugins.childBrowser.showWebPage(TwitterUrl,{showLocationBar:true});

I use these three methods with the ChildBrowser plugin. It really enhances the control for the app. I can grab the URL from the browser and parse it. This is useful especially for Twitter Integration where I can load the message just tweeted and save it to a database.

You can also modify the .java file and hide the 'prev' and 'next' buttons, so that the user only sees the 'Exit' button. This will return the user to your app (quiet simply the ChildBrowser disappears) but you have a history of the URLs that were visited during that session, and with the QueryString data you can analyse some of how the user interacted.


I don't think its possible. When you open another page on a different domain, you have no more control over it. the users has to exit buy them self

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜