11-08-2009 04:01 PM
If I have two fully independent java applications, is it possible for me to combine them into one application and create a menu item to switch between the two?
Solved! Go to Solution.
11-08-2009 08:04 PM - last edited on 11-08-2009 11:22 PM
In general yes, though you might find some details make it more complicated. And there is an alternative, which I will describe...
First option. Assume that you have two standard RIM type applications, each of which pushes a MainScreen. Call these screen A and screen B. Combine, and then have your main push Screen 1 - which can have two buttons it which push screen 1 and screen 2 respectively. Aside from that you can pretty much leave the two applications alone, they will work OK independently, assuming they have different package/class names.
Another alternative is to create an alternate entry. You have your standard application that pushes Screen A. Create an alternate entry, specifying a different main string (let us say it specified "B" as the parameter). Now in the main() method, check for the "B" and then create another Application instance and a completely separate 'enterEventDispatcher which pushes screen B'. This will give you two different applications, with two different icons, but only one set of cods,
Not sure you want the second option (two different icons) but thought I would mention it for completeness.
11-08-2009 10:36 PM
Thanks! I don't know what I was doing wrong, so I just rewrote everything from scratch and it's working perfectly like you have laid out in the first option.