Detect when the field gets the visibility on the screen

Hi gurus

I extended a BitmapField that when it is displayed on the screen is running a Thread internally in order to upload an image from a web server and then display it on the BitmapField. During the download of the Thread, it shows a dummy Bitmap.

I am now the list 15 images on a screen in a VerticalFieldManager, and as soon as the application starts, 15 thread starts to download each image.

When I run the application on the Simulator, with WiFi, all the images always get downloaded without problem all the time but when I run it on the device, sometimes the images are downloaded and sometimes some of them are not downloaded due to a "General socket error" (it is said the message of the Exception).

This behavior is kind of random, I wonder that it is a restriction on the number of requests that a device can perform the carrier (by BIS) at the same time or something like that. Sometimes 15 images are always downloaded without problem.

Now, the important thing, to circumvent the problem, what I'm trying to do is:

Even if I add 15 images on the screen, only 3 images are visible at the same time (on the Curve 8520 in which I am testing now) so I'll try to find a way that only these 3 images run the download thread and when the user makes a scrolling to the bottom of the screen, the fields earning "visibility" on the screen start to run in their own thread too but didn't find a way to detect if a field of on the screen, and not only in the manager gains visibility of

I try with:

protected void onVisibilityChange(boolean visible)

But as soon as the Manager is loaded on the screen, all fields run this even if events are now actually visible on the screen (they are in the lower part of the Manager)

Is it possible to know when a field get visible only on the actual device screen and not on the virtual screen?

Thank you!

This might not work on all devices, but the first invocation of painting of the field is a good indicator.

In my experience, the interface user of BlackBerry is very economical - everything that is not on the screen isn't painted. well, something that used to be on the screen and got a scroll being on could still be there in an internal buffer, so his painting could not called at all when it scrolls- but the first seems to be a pretty reliable indication.

Tags: BlackBerry Developers

Similar Questions

  • Detect when the screen goes black (standby mode)

    Is there a way to do this?  OnObscured does not seem to be called, that makes sense.  I couldn't find anything on the forums about this.

    Thank you.

    Thank you guys.  In fact, I realized that onVisibilityChange is what I'm looking for.  It is called when the screen goes black and when the screen is popped.

  • Detect when the menu is opening and closing

    Hello

    In my application, I use the ESC key to return to the previous screen.

    The problem is when to press the MENU button, a menu appears, and it must be able to use the ESC key to close the menu (if he wants).

    So, I would detect when the menu is opened and when the menu closes, I can manage the ESC to go back screen or simply to close the menu.

    Is it possible to do this?

    Thanks in advance

    Hai

    Do not use keylistener.

    Override keyChar() in your screen and locate the ESC key.

  • How can I detect when the last container in my stream is full?

    I have a bunch of related containers which I am flowing text through. How can I detect when the text has filled a container? There's an overflowPolicy then I guess it can be detected.

    Hello

    I used this:

    private function IsOverset(textFlow:TextFlow):Boolean

    {

    var zeComposer:IFlowComposer = textFlow.flowComposer;

    var iTextLen:int = textFlow.textLength;

    var iNoController:int = zeComposer.findControllerIndexAtPosition (iTextLen - 1);

    return (iNoController is-1);

    }

    HTH,

    J.

  • which method is called when the screen has lost focus but stays on blackberry?

    Hello

    I want to know in which method is called when the screen has lost focus, but always visible BlackBerry?

    For example, a screen is in the foreground and we disply dialog box so that the screen is visible but not to focus, therefore, at this time that methos called when we close this dialog box?

    Please, help me please please

    Override the following methods in your class to screen according to your needs

    1. when the screen button to the stack

    Call

    onDisplay() or

    onUiEngineAttached(boolean attached) - so attached is true then your screen is at the top of the screen

    2. When you are in a backlight and the lcd screen turns off to your state of rest and turns on again when you actively use this form

    call

    onVisibilityChange(boolean visible) - if visible is set to true, then you get the focus when the lcd display turns

    3. when your application moves to the background by clicking the red end button (i.e. without quiting the app, yet yours is active in the background)

    call

    onExposed() - when your application comes to the foreground of the background or during any type of screen that is in the top get popped

    & call

    onObscured() - when your application moves to the background, or when a screen pushed above your current screen more

  • Bluetooth freezes when the screen turns off

    Having a problem with the Bluetooth on my pre. I coupled it with a Plantronics Voyager 855. Initial pairing works very well, but after the screen on the pre turns off, the connection goes bad. When I turn the screen back on, the Bluetooth application on the phone always displays the connected headset, but it is not. If I try to play music, there is no sound, and if a call comes in, I can hear the person on the phone, and not on the helmet.

    About 30-45 seconds after the screen turns off, I hear the high tone of the headset which means that it has lost connection. I don't think that the headset is bad. It worked very well with my previous phone.

    If I have music when the screen turns off, the connection is very good. It's like, when there is no active communication between the phone and the headset, and the screen turns off, the bluetooth on the phone goes into a blocked State. I can restore the connection by turning off bluetooth on the phone and then on again. It reconnects to the helmet, until the next time the screen turns off.

    I tried this to get a better idea of the problem...

    If I remove helmet > disable bluetooth phone > turn on bluetooth on the phone > put the headset in pairing mode, it pairs fine.

    If I remove helmet > disable bluetooth phone > turn on bluetooth on the phone > turn off the screen > wait 45 sec > turn on the screen > put the headset in pairing mode, then it does not.

    Again, it is like turning off the screen causes the bluetooth of the phone hang. Given that the screen turns off fairly quickly, I basically disable bluetooth phone and back on every time I want to use it.

    Any thoughts?

    My problem is solved.  Turns out that I had a defective unit.  He traded last night, and it works fine now.  Got the yellow box this time.  First of all, we had the black cover.

    The swap was a little complicated.  I bought in a store of absolute Wireless in Garner, North Carolina.  It is a reseller of third party.  They did it to a Sprint service center to have a technician "certify" the default before they would replace it by car through the city.  And of course, the service center couldn't do the replacement, so I had to go back through the city to the point of purchase after they certified it.  Best of all, the procedure of "certification" involved explaining the problem to the technician for about a minute, she agreed with me that it was malfunctioned and his writing his employee with the ID on the back of a business card to bring back me to the first shop.  She has not yet turn the phone on itself.  She said pretty much the guy to the absolute Wireless has been a * beep * by sending me to it in the first place b/c, we could just do this by phone.  PITA BREAD.  But I suppose it is, that's what I to do not buy directly from Sprint.

  • Can not see the notification when the screen is locked

    When adding exchange (outlook) account, and because it requires security settings, I'm not in a position more to see notifications when the screen is locked.
    I deleted the exchange account, and notifications are visible when the screen is locked.
    To confirm, I added my exchange account again, and notifications is not visible when the screen is locked.
    I need to unlock to see the notification.
    How to solve this problem to take advantage of this last feature.
    Thank you.
    Saami.

    Topic locked as response has been received and there is already a topic about this.

  • U2715H - Windows automatically resized when the screen turns off then turn it back on

    • Windows 8.1 Pro
    • 1 single monitor connected to the PC
    • native resolution 2650 x 1440 at 60 Hz the value
    • through CDM of the monitor to the RFP the ti EVGA 750 SC (cable Dell)
    • all drivers updated on 28/12/15

    I just bought this monitor and I noticed this strange behavior. Whenever I have turn off the monitor (or it will turn off by itself), if I didn't have a maximized window, all windows (regardless of size) gets automatically resized to fit in the left upper quadrant when the screen turns back on again.  If I had something full screen, this behavior does not occur.

    I find this very annoying. This behavior happened with my previous monitor, which was only 1080 x 1200.

    I was unable to find any setting for the U2715H disable this "feature". This isn't because EasyArrange from Dell. I do not use this feature. And this always happens with Display Manager not installed.

    Is it just a 'feature' of Dell U2715H? Is responsible for Windows? Help, please.

    TIA

    There was no pilot or changes to the hardware of my first post.  BTW, my monitor is a Rev A02.

    A few days after my previous message, another question emerged.  Monitor flash intermittently ON / OFF every few seconds.  I unplugged/replugged the cable CDM - DP and that seems to fix things... until the next day.  This time, I nothing could fix the random rotation power SWITCH of the monitor.  Desperate, I decided to plug an old HDMI cable, I had to hang out.  Flashing problem has been resolved.  Not only this, using HDMI solved my original problem of auto resizing windows.

    The solution to my original problem: use an HDMI cable.  I went to the Dell CDM - DP cable and the problem has been resolved; no more windows resize automatically when the monitor turns off in sleep/towers.  I always get the native resolution at 60 Hz and there is no noticeable disadvantages to the use of the HDMI versus DP interface.  I've been using the HDMI cable for about a week and there is no other issue.

    Just for additional verification, I bought an Accell UltraAV DP - DP 1.2 cable (B142C-007 b-2), one of the few officially approved by VESA (see link below).  Using this cable does NOT my automatic window resizing problem original.  I do not use it long enough to see if they would prevent the random flashing question.

    I still don't know the exact cause of my original question.  I guess it's a driver problem with DisplayPort standard.  But if you do not need DP 1.2 functionality, I suggest that you just use your GPU HDMI output (if she has a).

    www.DisplayPort.org/.../How-to-Choose-a-DisplayPort-Cable-and-not-get-a-Bad-One

  • App background stops when the screen turns off

    I wrote an Android app with a Service that receives events from the LocationService and the accelerometer and always try now to wear 10 BlackBerry. Tests on a Z10 STL100-2 10.1.0.4181

    Once the unit has remained unchanged for some time, the location listener is not registered, in order to save energy, and re-recorded a trip again.

    Don't worry, this can be disabled via the visible activity. But it must continue with the last State (start/stop) after the reboot.

    I even magically figured out how to add additional permissions for the manifest of BAR: "_sys_android_autostart_service" and "run_when_backgrounded".

    But as soon as the screen turns off, my application stops working. No location or accelerometer case being received. Turn on the display again, everything back to normal.

    It is meant to be a question about the accelerometer, but I could not find in the tracker.

    So my questions are:

    -Is it possible to port Android continue to receive events location when the screen is off?

    -Is it possible to port Android continue to receive events of accelerometer when the screen is off?

    -Will my service to continue to operate if more than 8 Apps began after mine? (And the user did not hit the close button)

    -The "headless" 10.2 mode help? (I currently only test with 10.1, because my service provider has not yet unlocked 10.2)

    -Finally, this would be possible with a native application? (I could port the port iOS... lots of fun...)

    Thank you very much for your help!

    PS: If it's of any interest: I use the plugin V1.6.1 Eclipse/ADT to package and install the bar.

    As reported here as well (and I'm sure in other places)

    http://supportforums.BlackBerry.com/T5/Android-runtime-development/accelerometer-turns-off-when-Scre...

    I'm working on a deal in the next version, similar to what we're doing with location requests (in other words, activate us the background mode if your app acquires a partial wake lock).

    Edit:

    So my questions are:

    -Is it possible to port Android continue to receive events location when the screen is off?

    (Yes, but you must hold a wake lock).

    -Is it possible to port Android continue to receive events of accelerometer when the screen is off?

    (For the moment, no, but I'll change that, so it behaves like location.)  Mind you, this could be used to work on old revisions of the software until the native sensors team added a background of sensor mode which is disabled by default and must be explicitly enabled).

    -Will my service to continue to operate if more than 8 Apps began after mine? (And the user did not hit the close button)

    (There are a lot of thing that matters if your Services happens to run or not, which is not limited to, but includes the number of applications already running and the status of the device memory).

    -The "headless" 10.2 mode help? (I currently only test with 10.1, because my service provider has not yet unlocked 10.2)

    (No, it's a native thing.  Your application is already technically without head)

  • Pre Bluetooth crashes when the screen turns off

    Having a problem with the Bluetooth on my pre. I coupled it with a Plantronics Voyager 855. Initial pairing works very well, but after the screen on the pre turns off, the connection goes bad. When I turn the screen back on, the Bluetooth application on the phone always displays the connected headset, but it is not. If I try to play music, there is no sound, and if a call comes in, I can hear the person on the phone, and not on the helmet.

    About 30-45 seconds after the screen turns off, I hear the high tone of the headset which means that it has lost connection.

    I don't think that the headset is bad. It worked very well with my previous phone.

    If I have music when the screen turns off, the connection is very good.

    It's like, when there is no active communication between the phone and the headset, and the screen turns off, the bluetooth on the phone goes into a blocked State.

    I can restore the connection by turning off bluetooth on the phone and then on again. It reconnects to the helmet, until the next time the screen turns off.

    I tried this to get a better idea of the problem...

    If I remove helmet > disable bluetooth phone > turn on bluetooth on the phone > put the headset in pairing mode, it pairs fine.

    If I remove helmet > disable bluetooth phone > turn on bluetooth on the phone > turn off the screen > wait 45 sec > turn on the screen > put the headset in pairing mode, then it does not. Again, it is like turning off the screen causes the bluetooth of the phone hang.

    Given that the screen turns off fairly quickly, I basically disable bluetooth phone and back on every time I want to use it.

    Any thoughts?

    My problem is solved.  Turns out that I had a defective unit.  He traded last night, and it works fine now.  Got the yellow box this time.  First of all, we had the black cover.

    The swap was a little complicated.  I bought in a store of absolute Wireless in Garner, North Carolina.  It is a reseller of third party.  They did it to a Sprint service center to have a technician "certify" the default before they would replace it by car through the city.  And of course, the service center couldn't do the replacement, so I had to go back through the city to the point of purchase after they certified it.  Best of all, the procedure of "certification" involved explaining the problem to the technician for about a minute, she agreed with me that it was malfunctioned and his writing his employee with the ID on the back of a business card to bring back me to the first shop.  She has not yet turn the phone on itself.  She said pretty much the guy to the absolute Wireless has been a * beep * by sending me to it in the first place b/c, we could just do this by phone.  PITA BREAD.  But I suppose it is, that's what I to do not buy directly from Sprint.

  • How can I save by iPad 3 when the screen is black and nothing appears?

    How can I save my iPad in ITunes or iCloud 3 when the screen is black and nothing appears?

    Is the empty screen, because just the screen is broken, or is the iPad just dead? Have you tried a soft-reset/reboot it?

    At least you can see what you touch on the screen of the iPad, you cannot force a backup to iCloud.

    If the iPad still works and is connected to wifi, a backup should automatically happen (if iCloud backups are enabled) if it is connected and the locked screen.

  • Yoga 2 pro 13'3 andro tab stops automatically when the screen is off & dosnt start evn battery is30 - 80%

    Hello

    I am facing this problem with Yoga 2 pro 13'3 pellets. It stops automatically when the screen is off and dosnt start until it is connected to the charger and press the same power button 30 to 80% battery. I don't know what it is. This happens every time

    No help for it?


  • What do you do when the screen starts to turn upside

    What do you do when the screen starts to turn upside

    Hello

    Please try this (Windows 7)

    Press the keys Ctrl and Alt at the same time then the arrow key press upwards (or downwards).

    Or fix this way

    • Right-click on an empty distinguished on desktop
    • Select Customize
    • Select display
    • Select change display settings
    • Do not use returned to the Orientation box.
    • Click OK/apply

    Kind regards.

  • Music player stopping when the screen is locked

    I have a problem with the music, stopping to play when the screen on my Defy lock.

    He does that you use the speaker or the headphones.

    I never used to do this, and I wonder if I clicked something in the settings of /preferences that makes close the player.

    Any ideas please?

    Thank you

    Richard

    What to do with Advanced Task Killer?

  • cannot answer phone when the screen goes black

    I have the PE. I also have the unchecked box that says to finish the call with press the button (when the screen times out). How can I answer a call once the screen has expired without pressing a button that ends the call?


Maybe you are looking for

  • Can no longer open the hard drive

    Hello I used my external hdd to 4 TB (connected to USB 3.0 to copy data through the CCC on another external hard drive. Somewhere in the Middle he stopped. When I try to open the 4 to (by clicking on it) the finder crashes - every time. I put inside

  • No Satellite C660-2DZ no drivers

    I didn't buy a share of satellite C660-2DZ no series of PSC1NE-01C004G5 not YB210637K and I put WIN 7 32 bit. I have try all the drivers from this site and no work, if you try to find this model of laptop on this site, does not exist in the list.I tr

  • Satellite Pro A200 - vertical scrolling on the touchpad doesn't work does not after update

    Hello My A200 told me that I needed to update the drivers for my touchpad. I did it and now I can't use the vertical scroll feature. I looked on the site Web of Synaptic and there is nothing there to help. I checked to see if I have the drivers updat

  • Pavilion dv6-1060eo - link to broken software!

    Hello. I wanted just to inform you that the download link for the "HP MediaSmart Webcam software" for the "HP Pavilion dv6-1060eo Entertainment Notebook PC" is broken. I would really like to download both and if I can use my webcam. Please correct. T

  • How to draw the graph of output?

    Hello How to draw the graph of an exit? is there any api for it?