tags:

views:

232

answers:

1

I'm having troubles with the UiApplication.activate() method firing post-app-installation (OTA install).

I have:

public class PlayerApp extends UiApplication

    public PlayerApp() {
       new Thread(this).start();
    }

    public void run() { ... }

    public void activate() { ... }

I'm having troubles with the activate() method. It's firing to early, it's firing post--installation when it shouldn't (I thought it should fire when the application is selected by the user from the menu). What makes it worse it's not occuring on all Bolds. The BB is meant to ask for a reboot, but activate() is firing before this point and plays hell with the UI.

Questions. When does activate() really fire? Should activate() be firing post-install anyway? Is there a way to handle activate() firing post-installation? Is this a bug in the rim apis?

Note: The problem appears on BB Bold 4.6.0.144/4.0.0.143 and thus far I've not been able to replicate the issue on 4.6.0.282/4.0.0.235.

Edit: Installation flow: OTA link > Download > Install > 'Yes' to 'Trust application status' > AutoStart app > Trouble starts here.

+2  A: 

According to the API docs activate():

The system invokes this method when it brings this application to the foreground. By default, this method does nothing. Override this method to perform additional processing when being brought to the foreground.

So, I suspect after OTA install the user is given the option of running the app which, when accepted, brings the app to the foreground. It is difficult to be certain without seeing your startup code. If your app is configured to autostart, then it will be "autostarted" after install. If this casues the UI to be instantiated and brought to the foreground, the activate will be called at that time.

Richard
That's what I read too, activate() fires on application to foreground. But it shouldn't. Yes we're autostarting. But on some phones activate() is fired, on others it is not. We're currently upgrading a Bold to the newer ver to see if it differs after an update.
Ben Clark-Robinson
Sry missed a bit. No the application never prompts the user. It simply activates once permitting trust status. And before the user gets the option to either reboot/later.
Ben Clark-Robinson