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
myquestion
Posts: 235
Registered: ‎11-12-2008
My Device: Not Specified

on reset the device or pull off the battery

Hi all,

say there is one pushGlobalScreen("",0,0); with a textbox and  with a ok button .Now puting a value say 123 in textbox the screen will goes off,and normally as we use the bb we will use that .now if i put a  pull off the battery or reset the device while pushGlobalScreen stays if not giving the right value,

it will again show the screen while we reset again or pull out the batterhy.

 

can any help how we will implement programatically

 

Thanks

Developer
DAquilina
Posts: 587
Registered: ‎01-19-2010
My Device: BOLD 9700 OS5.0.0.x on Rogers Canada
My Carrier: Rogers

Re: on reset the device or pull off the battery

So, you want a screen to persist through a full reset? I don't think you can -- programmatically or otherwise. If your program runs on startup, you can add your pop-up text to a persistent object, and immediately call the pop-up if the text != "" (or something to that effect), but it will have to be a new pop-up. The dialog cannot persist through power off.

 

If this is part of a multi-step process, you'd have to have a bunch of flags to indicate each step, which you reset when the process ends. So like...

 

vector persistentData = new Vector (4, 1);

// [0] = Text

// [1] = stageOne

// [2] = stageTwo

// [3] = stageThree

 

//Store these in the vector

//persist the vector using BlackBerry Persistance API

boolean stageOne = false;

boolean stageTwo = false;

boolean stageThree = false;

 

String popupText = "";

 

if (!stageOne)

{

  //do stuff

 

  stageOne = true;

}

 

if (!stageTwo)

{

  //do more stuff

 

  stageTwo = true;

}

 

if (!stageThree)

{

  //do last stuff

 

  stageThree = true

}

 

//Final stage

//clean up/do stuff

 

stageOne = false;

stageTwo = false;

stageThree = false;

 

//Note: All references to the vector components shoul be modified on the vector directly

//Note: Remember to commit the changes

 

--------------------------------------

 

Hope that helps,

~Dom

----------------------------------------------------------------------------
chown -R us ./base
~J!NX