Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified
Accepted Solution

Disable auto-run on startup

Is there a way to disable the auto-run on startup at run time?

I would like to give the user the option to disable the app from auto starting until he clicks on the application.

If this option is not available, is there a way to detect that the application has started from an auto start mode vs from a user clicking on the app icon from the home screen?

 

Thanks

BlackBerry Development Advisor
MSohm
Posts: 14,851
Registered: ‎07-09-2008
My Device: BlackBerry Passport

Re: Disable auto-run on startup

You can use the ApplicationManager.inStartup method to see if the BlackBerry is in the process of starting up.  Your application can only run when the BlackBerry is in this state if it was auto started.

 

There isn't any built in way to disable auto start, but you could build this logic into your application (not take any action until a user does something).

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
peter_strange
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: Disable auto-run on startup

I believe you could use an alternate entry to distinguish between the autostart and GUI started application.  See:

 

How To - Setup an alternate entry point for my application
Article Number: DB-00008
 
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800738/800901/How_To_...

Developer
simon_hain
Posts: 16,350
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Disable auto-run on startup

put a Boolean into persistant store and check the value in your autorun application. If it is non-existing or true continue, if it is false quit.
In your GUI you can set the value of the stored Boolean.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Developer
rab
Posts: 283
Registered: ‎07-22-2008
My Device: Not Specified

Re: Disable auto-run on startup

Thank you guys for the reply.

 

I used Mark's suggestion ( ApplicationManager.inStartup ) and built a logic around it. It worked fine and achieved what I was looking for..

 

Thank you all.