Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 67

ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
01/04/14 04:17 PM (11 years ago)

New plugin, being launched multiple times

Guys, I created a new plugin (lets call it plugin X) which basically launches a UIWebView instance. I am calling plugin X from the tab menu as well as a menu items on the main menu. Now Every time I click the plugin X's icon on the menu, it launches a new instance of the plugin. And I then click on the tab, it launches another instance of the plugin. Anybody know what code I can use or call so that it looks for an existing instance and reuses what's already there instead of launching a new one for every click
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/04/14 05:52 PM (11 years ago)
Are you pointing to the same screen (aka itemId) for both the tab and the menu item? What happens when you load the tab then switch tabs and come back (without going to the menu option)? Does it work properly then, or does it still load a new webview?
 
ElDorado
Aspiring developer
Profile
Posts: 41
Reg: Mar 25, 2013
Dallas
410
like
01/04/14 06:11 PM (11 years ago)
Yes I am pointing to the same screen ID in both tab and menu. When I go in through the tab and come back to the tab, it doesn't load a new instance. But each time I go through the menu item, it loads a new instance everytime. I want it to show the same state whether I launch it through the tab or menu
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
01/04/14 07:12 PM (11 years ago)
It's probably because when you leave the menu screen, it destroys the reference to it. Not sure there's much you can do.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.