12-06-2008 01:55 PM
I am currently developing a blackberry application for multiple devices. As such I have three releases to date one using v4.0.2 of the JDE, another using 4.2.1, and finally another using 4.6.0. Now I am receiving comments back to me that when users power off their Bold handhelds the next time they power on my application menu itemsI have added are not there and they need to run my application again to populate the menu items. I have not been able to recreate this behaviour on earlier devices like the 8830,8310 and 7520. So my question is what constitues a reset in the Bold? I am assuming that the device must be experiencing a reset which then clears the RuntimeStore where I place a key value pair to determine if my menu items have already been populated.
If this is expected behaviour on simply a shutdown, then I assume I must go forward using the PersistentStore approach. If so, when or how does the PersistentStore get cleared? Thinking further down the road if a client removes my app will this key/value pair persist inperpituity?
Thanks to any who can shed some light.
Solved! Go to Solution.
12-06-2008 03:23 PM
Looks like once again you have bailed me out of the fire. Thanks for the answer regarding the PersistentStore behaviour. Also, I am not too sure why I didn't add an alternate entry point to add the menu items on startup. I guess this would solve the issue on each reboot anyways, because the background thread would run each time the phone is rebooted, correct? Of course I will still need to check the store to make sure the menu items arent there already ... in the case of the phone not dropping them on a reboot, since it doesn't appear to happen everytime. I will try this approach and see if it corrects the issue at hand.
12-06-2008 03:56 PM - edited 12-06-2008 03:57 PM
Setting up an alternate entry point isn't the same as having a backgorund thread.
You create a 2nd project and click the property "alternate entry point". Then you add the arg that will be passed when your main() (something like 'gui')
So, what happens is your main gets called twice, once during startup and the again the first time your app icon is clicked on by the user.
So, you add your menu items on intitial startup, then you enter the event dispatcher and push your screens on the "gui" entry.
There is an example is in the developers guide.