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
New Developer
srinivasvadde
Posts: 8
Registered: ‎12-04-2008
My Device: Not Specified
Accepted Solution

Application lunching automatically

Hi,

 

I am facing one issues with RIM OS 5.x devices. my application lunching automatically when pressed Back button during the backlight off.

please any suggest.

 

Thanks,

Srini

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

Re: Application lunching automatically

I haven't heard of anything like this happening before.  Is your application running in the background?  It could be that the user is dismissing the current application (pressing the escape key) and then your application is shown (it was running "under" the previous application).

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
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Application lunching automatically

maybe its hungry

----------------------------------------------------------
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
New Developer
srinivasvadde
Posts: 8
Registered: ‎12-04-2008
My Device: Not Specified

Re: Application launching automatically

[ Edited ]

Hi Mark Sohm,

 

Thanks for replay,

 

My Application not running in background and it's completely closed.

 

Actually am using the schedule launching to my application at particular time by using below method. ApplicationManager.getApplicationManager().scheduleApplication(Date). due to this application launching when pressed Back button[escape key] during the Backlight off??

 

Thanks,

Srini

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: Application launching automatically

So that we are sure about this question, can you confirm the problem you are seeing.

 

You schedule your application for a specific time.  However you are finding that it does not matter what time you set, your application will always launch when the Back button is pressed and the Backlight is off. 

 

Is this correct?

 

One obvious question.  Are you sure it was the Back button that launched your application?  It could have launched itself and you did not notice because the back light was off.  One way to be sure this is not happening is to have your application turn the Backlight on. 

 

Do you see this on the Simulator?

 

Have you debugged your application a device to confirm it happens exactly when the Back button is pressed?

New Developer
srinivasvadde
Posts: 8
Registered: ‎12-04-2008
My Device: Not Specified

Re: Application launching automatically

Hi Peter,

 

Please find my comments in line

 

So that we are sure about this question, can you confirm the problem you are seeing.

 

You schedule your application for a specific time.  However you are finding that it does not matter what time you set, your application will always launch when the Back button is pressed and the Backlight is off. 

 

Is this correct?

 

Srini: Yes, My application will always launch when the Back button is pressed and the Backlight is off. i tested no. of times but result is same. This problem faced only when pressed Back button[Escape key].

 

 

One obvious question.  Are you sure it was the Back button that launched your application?  It could have launched itself and you did not notice because the back light was off.  One way to be sure this is not happening is to have your application turn the Backlight on. 

 

Do you see this on the Simulator?

 

Srini: no issue with simulator, everything working fine.


Have you debugged your application a device to confirm it happens exactly when the Back button is pressed?

 

Srini: This is happens After the Backlight off when pressed Back button.

fasing this issue with BB 9700[OS 5.0.0.351] & BB 9000 [OS 5.0.0.494]

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

Re: Application launching automatically

I tried to reproduce this with the sample below, but wasn't able to.

 

Allow an application to restart itself

http://supportforums.blackberry.com/t5/Java-Development/Allow-an-application-to-restart-itself/ta-p/...

 

Can you give that sample a try and see if you see the same behaviour as your application?  If you don't, please post some sample code from your application that triggers this behaviour.

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
New Developer
srinivasvadde
Posts: 8
Registered: ‎12-04-2008
My Device: Not Specified

Re: Application launching automatically

[ Edited ]

Hi Mark Sohm,

 

I figure out the issue and resolved.

Details as : Actually in my application I registered KeyListener interface for key event capture.

Please find the below code snap

 

public class Abc implements KeyListener

{

public boolean keyDown( int a_KeyCode, int a_Time)

{

int rimKeycode = Keypad.key(a_KeyCode);

if(rimKeycode == Characters.ESCAPE)

{

// doing some operation here

}

return false;

}

}

 

I tested with debug client multiple times and found different KeyCode for the Characters.ESCAPE.

1. When Application is running and Backlight On then press Back button

    the value ofCharacters.ESCAPE is

          a. rimKeycode = 27

          b. a_KeyCode = 1769472

2. When Application not running and Backlight Off then press Back button

     the value of Characters.ESCAPE is

          a. rimKeycode = 27

          b. a_KeyCode = 1769600

 

My question is, when my application is completely closed and Backlight Off, But my application Abc class still listening the key events and every time of Back Button(only pressed Escape key) pressed its calling the keyDown() method. Now I am handling the keyCode(1769600) so that my issue is fixed.

 

Please let me know, why internally the keyDown() called when Backlight Off and with different keyCode ??

 

Thanks,

Srini

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

Re: Application launching automatically

keycode is a bitflag. i suppose backlight off is included in the bitflag. if you substract both numbers you get 128, or 10000000b, which seems to be the flag for the backlight.

----------------------------------------------------------
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
New Developer
srinivasvadde
Posts: 8
Registered: ‎12-04-2008
My Device: Not Specified

Re: Application launching automatically

Thats ok, but why internally calling the keyDown() method when Backlight is Off ??