GIFEncodedImage in BlackBerry OS7

I had a problem on BlackBerry JRE 7.0 when I tried to display custom dialog box. It show ClasscastException on a Simulator screen when I debugged my code I found that it carshed when I try to use GIFEncodedImage and this is my code:

package com.codemobiles.bb.thaidict;

import com.codemobiles.bb.thaidict.custom.field.AnimatedGIFField;

import net.rim.device.api.system.GIFEncodedImage;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Keypad;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.ButtonField;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class LoadingScreen extends PopupScreen implements FieldChangeListener{

  protected boolean keyChar(char c, int status, int time) {
    // TODO Auto-generated method stub
    if (c == Keypad.KEY_ESCAPE) {
      close();
      return true;
    }
    return true;
  }

  public ButtonField dissmissButton;
  public LoadingScreen(VerticalFieldManager delegate){
    super(delegate);
    HorizontalFieldManager loadingManager = new  HorizontalFieldManager(Manager.FIELD_HCENTER);
    GIFEncodedImage image = (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("img/load.gif");
    AnimatedGIFField gifField = new AnimatedGIFField(image,Field.FIELD_HCENTER);
    LabelField loadingLabel = new LabelField("Being Translated..");
    dissmissButton = new ButtonField("Cancel",Field.FIELD_HCENTER);
    gifField.setMargin(4, 10, 0, 0);
    loadingManager.setMargin(0, 0, 7, 0);

    loadingManager.add(gifField);
    loadingManager.add(loadingLabel);
    add(loadingManager);
    add(dissmissButton);
    dissmissButton.setChangeListener(this);
  }
  // TODO Auto-generated constructor stub}

  public void fieldChanged(Field field, int context) {
    // TODO Auto-generated method stub
    if(field == dissmissButton){
      close();
    }
  }

}

He carshed at this line:

GIFEncodedImage image = (GIFEncodedImage) GIFEncodedImage.getEncodedImageResource("img/load.gif");

This code is very well working on BlackBerry OS 5-6.

Does anyone know about this problem and how to fix it?

Thank you

Concerning

Rename the GIF file in the resource with the extension .agif.

It works in my code. Try this

Tags: BlackBerry Developers

Similar Questions

  • Trasnfer blackBerry 10 data saved BlackBerry OS7 to Andriod using the switch of the device

    Is it possible to transfer data saved using switch of the device, Blackberry OS7 running on Andriod phone?

    Help, please! Thank you!

    No, the switch device app goes beyond data transfer on a device BlackBerry 10 only what it is built to help users MOVE for BlackBerry 10.

    Webcast of switch device: BlackBerry OS smartphone to smartphone BlackBerry 10

    Switch appliance Webcast: OS Android smartphone to smartphone BlackBerry 10

    Switch appliance Webcast: iOS smartphone BlackBerry 10 device

    See you soon!

  • FIREFOX runs on Blackberry OS7?

    I use FIREFOX on my BB "BOLD".

    Sorry Mate,.

    Because of the development system based on Java and the inability to create C/C++ applications, the full Firefox browser won't be available on the Blackberry operating system.

    https://wiki.Mozilla.org/mobile/platforms#Other_Platforms

  • Smartphones BlackBerry OS7 update for Torch 9800 blackBerry?

    Hi community, my blackberry torch 9800 camera icon is entirely absent. It is not in the hidden list so I can't quite locate nor can I take pictures, please help.

    REMOVE ALL THIRD-PARTY APPLICATIONS IN MY WORLD (IN THE WORLD OF BLACKBERRY). RELOAD OS USING DESKTOP MANAGER. ONLY BACKUP CONTACTS ON THE DESKTOP BEFORE. AFTER THAT RELOAD OS ONLY RESTORE CONTACTS. IT WILL CLEARLY BE A PROBLEM WITH THE OPERATING SYSTEM ERROR

  • Code to reset factory settings in Blackberry OS7?

    Hello

    I'm creating an application that requires to factory settings. I don't get a class and a code to reset.

    How can I do this using the. NET.Rim library.

    This can be done from a command line to a device connected via USB with javaloader using the command below.  It is not possible for an application running on the device triggered this.

    javaloader -u resettofactory
    
  • Q10 blackBerry download full - cannot open the file

    My previous Blackberry Curve 8330 (using version 4.0 of the software), I had an eSecure app that I downloaded from a text message sent to my phone.  With my new Q10, I "ve done to transfer the data from my old phone again, but the apps has not been transferred.  All lists of contacts, emails, etc. worked well.

    I logged on the site where I can go to request a new message text for the app, but the OS Q10 is not an option, the highest available Blackberry version is 7.0.  When I select 7.0 and receive this new text message on my phone, I open it and the link download, but when I click on the downloaded file I get a popup message that says: "Cannot open the file."

    Please notify

    Applications BlackBerry OS7 (and OS4) do not work on OS10. OS7 (and the previous operating system) is based on Java, OS10 is completely different (QNX based). So if the seller does not level its app to OS10, there is nothing you can do.

  • The blackBerry Smartphones OS update

    Hello, can I update my blackberry 9800 OS 6 to 7 OS? Thank you

    Hi @NEW07499

    BlackBerry OS7 is not supported on the 9800 - it is supported designed for those who use a 9810. Sorry!

  • BIS and BES blackBerry smartphones

    Is could someone please tell me what do these letters mean?

    BIS - BlackBerry Internet Service, legacy data network, the elderly for BlackBerrys via BlackBerry OS7

    BES - BlackBerry Enterprise Service, the compliment of the business to business networks, mainly for businesses and the features of the employee.

  • BlackBerry Smartphones Adobe Flash videos does not not on the Torch 9860

    I bought a new torch 9860 with OS7. When I try to open any flash video of facebook, it does not open and said my doesnot support this phone. on the adobe site, there is not available for blackberry os7 flash drive. any suggestions?

    You won't find Flash on many phones, including all BlackBerry phones. The BlackBerry PlayBook is. You can try the facebook site m.facebook.com mobile.

    I hope that helps you.

  • RimAlbumArtDaemon quit unexpectedly

    Nice day

    This message comes up with frequent regularity, it finally came when I have access to LinkedIn via a browser with Itunes on. I think that I have to uninstall something (my software Backberry) but could not find the exact path to access. The software was supposed to synchronize Blackberry OS7 with Mac and I can't live without it (if I can find it). Thank you

    Have you checked the web site Blackberry.RIM for the instructions to uninstall?

    Ciao.

  • BBM cannot configure BBM for 9900

    When I hit the bbm, it says he "cannot configure bbm" (not enough wireless coverage or your connection to the wireless network is turned off)... so I can't click anything on the screen... Please help on what to do because almost 3 days that I can not use my bbm. Thank you...

    BlackBerry devices running BlackBerry OS7 (like your Bold 9900) and below require a data plan services of BlackBerry to use BBM.

  • BlackBerry Smartphones OS7 vs OS10

    Hey guys, I was just wondering, what are the differences in the OS7 BBY and OS10 BBY? As for most, the look, the feel and of course, options and features. I don't say that as I think that there is no difference because I would personally have no idea, but if someone could tell me would be great. I hope you all had a great day of work!

    Here are some useful links on the differences:

    Post material: http://blogs.blackberry.com/2013/02/blackberry-10-vs-blackberry-7/

    Hands on review of BBY Z10 and OS10:
    http://m.YouTube.com/watch?v=JoYOphnK808

    And you don't need a review of OS7 because each of you, storm users must be run on your phone and know how it works. After that, I could get a Z10.

  • Smartphones from blackBerry Torch 9860 upgraded to OS7.1

    I've updated to OS7.1 and I can't find the FM radio. Now I don't really know if the BB Torch 9860 is featured to get it and upgrade.

    Help please.

    Hello

    Please see this:

    As you will read, your model does not include the necessary equipment (a FM radio tuner) for this feature.

    Good luck!

  • BlackBerry smartphones, that I can't seem to get OS7.1 for my 9900

    I can't seem to DL OS 7.1 to my bold 9900, I am based in South Africa and use Vodacom as my SP.

    I tried to update my software online this week, but he told me that my software is up to date, and yet my phone tells me that my software is version 7.0 Bundle 2406.

    7.1 is not available in SA or via the Vodacom network?

    I really want to improve some features 7.1 are what I'm looking for.

    Operating system device provided are "released" by specific carriers once that they are certified and trained to their support technicians, but still, you are able to load any carrier the same model by following the instructions below. Apparently, Vodacom has not yet published OS7.1

    Start by searching for your carrier or another carrier who has 7.1 and the file of the operating system you want to use.
    http://NA.BlackBerry.com/eng/support/downloads/download_sites.jsp

    Make a backup of your device first, using Desktop Manager > backup. Close the office at the end Manager.

    1. download the OS files to the PC then install on the PC by running (double click) the downloaded file.
    2. go in c:\program files Research in motion\apploader and delete the file named "vendor.xml."
    3. plug in the BB and double-click on "Loader.exe." It is located in the same place as the above vendor.xml file.

  • Smartphones from blackBerry Bold 9650 & os7.1

    It is reasonable to assume that my Blackberry Bold 9650 is not compatible with the new os7.1?

    I recently did an upgrade for my os and he said that I was running the most up-to-date available 6.0

    I guess I was hoping I'd be able to download the new os7.1 to my phone.  Wanted to especially

    reactive enforcement of the zone.

    Thanks in advance.

    Bob

    Hey, it's safe to assume... and a fact.

    The 9650 will not get the 7.1 upgrade nor upgrade 7.0.

Maybe you are looking for