FilePicker.Listener problem

For some reason, Eclipse can not resolve the type FilePicker.Listener. If I leave aside the listener, the FilePicker runs great. I am glad that it was finally added to the API. Problem is that if I set up a listener, I'll never know which chose heh is example of my code below:

import net.rim.device.api.ui.picker.FilePicker;

/* Other code here */

private MenuItem setBackground = new MenuItem("Set Background", 100, 2) {
            public void run(){
                final FilePicker filePicker = FilePicker.getInstance();
                String startPath = "file://store/home/user/Pictures";
                filePicker.setPath(startPath);
                String filterString = "jpg";
                filePicker.setFilter(filterString);
                filePicker.setListener(new FilePicker.Listener(){  /* This line is highlighted red with the error */
                    public void selectionDone(String str)
                    {
                        Dialog.alert("You selected " + str);
                    }
                });
                filePicker.show();
            }
        };

As I said, I will not have problems with FilePicker... Just FilePicker.Listener. Eclipse only says:

"The net.rim.device.api.ui.picker.FilePicker$ Listener of type cannot be resolved." It is indirectly referenced from .class files required.

BlackBerry JDE is included in the path of the construction... This is how the rest works right

Any ideas?

I know that people have implemented this before, I just checked and the interface does not exist as you said. If you happen to have a copy of JDE 5.0, it has a good copy of the class w / interface.

Your options are:

  1. Use the JDE
  2. Copy the net_rim_lib.jar in the lib folder in the JDE in the lib of the Eclipse component Pack folder.
  3. Copy the file net_rim_lib.jar from the JDE to the net_rim_lib.jar of the Eclipse of the component pack file.

I'd go with option 3 but for option 2 and 3, you should make a backup of the original and you do at your own risk.

Tags: BlackBerry Developers

Similar Questions

  • Listener problem

    Hello! One of my database servers, I have following problem:

    [oracle@dev PRODCLON_dev] $ lsnrctl status PRODCLON

    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on November 30, 2012 16:11:27

    Copyright (c) 1991, 2008, Oracle. All rights reserved.

    Connection to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = dev.synechron .net)(PORT=1523)))
    STATUS of the LISTENER
    ------------------------
    Alias PRODCLON
    Version TNSLSNR for Linux: Version 11.1.0.7.0 - Production
    Start date November 30, 2012 07:59:40
    Uptime 0 days 8 hours 11 min 47 s
    Draw level off
    Security ON: OS Local Authentication
    SNMP OFF
    Parameter Listener of the /oracle/PRODCLON/db/tech_st/11.1.0/network/admin/PRODCLON_dev/listener.ora file
    The listener log file /Oracle/PRODCLON/DB/tech_st/11.1.0/Admin/PRODCLON_dev/diag/tnslsnr/dev/prodclon/alert/log.XML
    Summary of endpoints listening...
    (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = dev.synechron .net)(PORT=1523)))
    Summary of services...
    Service 'PRODCLON' has 1 instance (s).
    Instance of 'PRODCLON', status UNKNOWN, has 1 operation for this service...
    The command completed successfully
    [oracle@dev PRODCLON_dev] $ tnsping PRODCLON

    AMT Ping utility for Linux: Version 11.1.0.7.0 - Production on November 30, 2012 16:14:27

    Copyright (c) 1997, 2008, Oracle. All rights reserved.

    Use settings files:


    TNSNAMES adapter used to resolve the alias
    Try to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=dev) (PORT = 1523)) (CONNECT_DATA = (SID = PRODCLON)))
    OK (0 msec)
    lsnrctl stop $ [oracle@dev PRODCLON_dev] PRODLCON

    LSNRCTL for Linux: Version 11.1.0.7.0 - Production on November 30, 2012 16:14:33

    Copyright (c) 1991, 2008, Oracle. All rights reserved.

    AMT-01101: could not find the name of service PRODLCON


    [oracle@dev PRODCLON_dev] $ tnsping PRODCLON

    AMT Ping utility for Linux: Version 11.1.0.7.0 - Production on November 30, 2012 16:19:51

    Copyright (c) 1997, 2008, Oracle. All rights reserved.

    Use settings files:


    TNSNAMES adapter used to resolve the alias
    Try to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp)(HOST=dev) (PORT = 1523)) (CONNECT_DATA = (SID = PRODCLON)))
    OK (0 msec)
    [oracle@dev PRODCLON_dev] $ echo $ORACLE_HOME
    /Oracle/PRODCLON/DB/tech_st/11.1.0

    [oracle@dev PRODCLON_dev] $ echo $ORACLE_SID
    PRODCLON

    What could be the reason why I'm not able to stop the listener?

    lsnrctl stop $ [oracle@dev PRODCLON_dev] PRODLCON

    Spelling error I guess

    lsnrctl stop $ [oracle@dev PRODCLON_dev] PRODCLON

  • RAC - remote Listener problem

    Hey guys, I got a call with the support of the oracle, but they are just to slow down, so I need to ask the real experts in :-)

    I have 2 CCR node with 3 databases on this subject.
    Also I have 2 more machine that have installed the connection manager, and those that are used to connect to the database via a web application. Everything is good...

    I created an entry to listener for the cluster of connection manager and set the parameter remote_listener for this entry.
    Thus, one of the 3 database registers its service on the connection manager. Still all good. Life of the connection the webapp works very well.

    BUT! When I try a local sql (connect sys/password@dbsrv as sysdba) connection sometimes TNS error code.
    ORA-12514: TNS:listener is not currently of service requested in connect
    Descriptor. tnsping works fine for the database. the normal listener also shows the correct state of the database
    lsnrctl status...
    Service 'dbsrv' has 1 instance (s).
    'Dbsrv1' instance, State LOAN, has 2 managers of this service...
    ....

    When I put the remote_listener parameter 'scan_listener:1521' sql connection cluster works.
    Also I can´t get a valid cluster resource connection state in enterprise manager, when the remote_listener parameter is set to cman listener.
    When the parameter is set to the name of the scan enterprise cluster manager works fine as well
    But when his game up to the listener to cluster, the database is registered to the listener of connection manager. If no connection is possible.

    So two questions left...
    Can I have an entry for the connection manager in the tnsnames.ora and set the parameter remote_listener for this entry?
    What impact does -
    Why is a local sql connect is not possible when the remote_listener parameter is not set?

    The EM is a no prior problem, but ideas to that as well?

    Hi Christian,

    what I mean by that, you can include 2 settings in the entry of remote_listener. So include SCAN + CMAN:

    ALTER system set remote_listener = "SCAN - cluster:1521","(DESCRIPTION=(address_list=(address=(protocol=tcp)(host=cmahost01)(port=1610))(address=(protocol=tcp)(host=cmahost02)(port=1610)))";

    It would be possible to do something like:

    ALTER system set remote_listener = "SCAN-cluster: 1521", "cman_listener";

    as well, but I have not tried.
    If you set this, just check after a record of system alter, if CMAN both SCAN knows the database service (lsnrctl status )

    Sebastian

  • Adding listener problem after sending the Mail

    Hi all

    I have to add listener after sent mail because I tested a service when the mail will be sent.

    Help, please!

    Its Urgent...

    Thank you!

    Copy the following code

    Message m = new Message();
    
            long millis = System.currentTimeMillis();
            Date d = new Date(millis);
    
            m.setSentDate(d);
    
                Address a = null;
            try{
                        a = new Address(_dto.get_email(), _dto.get_fname() + " "
                                + _dto.get_lname());
    
                    } catch (AddressException e) {
    
                        e.printStackTrace();
                    }
                }
            }
    
            try {
    
                m.addRecipients(
                        net.rim.blackberry.api.mail.Message.RecipientType.TO,
                        addresses);
            } catch (MessagingException e) {
    
                e.printStackTrace();
            }
            try {
                m.setContent("\n\n\nbody");
    
                m.addMessageListener(new MessageListener() {
    
                    public void changed(MessageEvent e) {
    /////// here you can check the messageevent instance and check the code //of the event
    
    if (e.getMessage().getStatus() == Message.Status.TX_DELIVERED
                                    || e.getMessage().getStatus() == Message.Status.TX_SENT) {
                                //Message Sent
    
                            } else if (e.getMessage().getStatus() == Message.Status.TX_ERROR
                                    || e.getMessage().getStatus() == Message.Status.TX_GENERAL_FAILURE) {
                                //Message failed
    
                            } else
    //Pending
    
    }
    
    } catch (MessagingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
                    new MessageArguments(m));
    
  • Popup + before the stage listener + problem commandlink

    All,

    I have a phase listener configured on a page to open a popup and it works fairly well, i.e. the popup is open when the page is loaded. Now, I want to show the popup even when the user clicks on the commandLink. So I configured the commandLink to have a showPopupbehaviour as his child. The question is when I click on the order link that the popup is not opening. However if I remove the call to forward phase listener (), the popup is get called from the command link.

    Please advice what's wrong in this case? Ideally both should work independently.
    I tried to address the immediate and automatic submit also but no effect.

    thnks
    11.1.1.5 Jdev

    Hello

    using af: showPopupBehavior issues a request to the server, which then also is treated by your phase listener. Add some logic to your phase listener for does not work when you press the command button. You can for example define the command button on partialSubmit = true and then check if the request is a partial request AdfContext.getCurrentInstance () .isPartialRequest (facesContext) in this way the listener of phase opens the popup when a page loades but is no longer after.

    Frank

  • Bitmap Event Listener problem :(

    Hey,.

    I met a problem of bitmap to seal my image in my project.

    Because event listeners do not work on images bitmap, I have trouble on what to do next if I can use on my image event listeners.

    Main class - section that adds the image to the class:

    
    
    
    
    
    
    var playImage:Bitmap = new Assets.play();
    
    
    
    
    
    
    playImage.x = 190;
    
    
    
    
    
    
    playImage.y = 165;
    
    
    
    
    
    
    playImage.name = "play";
    
    
    
    
    
    
    addChild(playImage);
    
    
    
    
    
    
    
    
    
    
    playImage.addEventListener(MouseEvent.CLICK, playClick);
    
    
    
    
    
    
    playImage.addEventListener(MouseEvent.ROLL_OVER, playRollOver);
    
    
    
    
    
    
    playImage.addEventListener(MouseEvent.ROLL_OVER, moregamesRollOut, false, 0, true);
    
    // ^^ Those EventListeners don't function because the image is Bitmap and it won't allow me to add the photo as a MovieClip 
    
    

    Asset class - how I integrated the image in the class:

    
    
    
    
    [Embed(source="../images/play.png")]
    
    
    
    
    public static var play:Class;
    
    
    

    How do you do that for event listeners is working on my embedded image?

    I work with pure as3 in Flash Builder.

    Thank you

    McbainGames11

    I do not work in Flash Builder, but...

    I usually create a Sprite, which adds to the scene and then add the bitmap to the sprite. For example:

    var playImageHolder:Sprite = new Sprite();

    addChild (playImageHolder);

    var playImage:Bitmap = new Assets.play ();

    playImageHolder.addChild (playImage);

    playImageHolder.x = 190;

    playImageHolder.y = 165;

    etc...

  • When I listen to the radio or pandora sounds stops unless I move my mouse, how can I solve this problem?

    Whenever I'm listening to the radio or talk radio, the sound stops unless I move my mouse every 5 seconds dam... It really starts to pi * me off. Whatever the new add on no you guys sent please, get rid of it. I tried to restore my computer to an earlier date and work until the dam update download again. So I tried to delete a reinstall of firefox... Nothing works.

    This problem is limited to audio players?

    There is a much more serious problem affecting some users Firefox 25 where the browser stops just do nothing until the mouse is moved again. The best solution for this at the moment is back at 24 in Firefox. It has a link to the old installer in this article: install an older version of Firefox. To change your update settings so that you can see Reinstalling Firefox 25, see this article: Advanced panel - accessibility, navigation, network, updates and other settings in advanced Firefox.

  • Problems listening to MIDI files in Mail.app

    My parents recently moved from a Windows 7 PC to an iMac.

    My mother is part of the singing group and is sent to the MIDI files of different parts of song to practice at home.

    In the past, she has been able to open files directly from noon in his e-mail on the PC application.

    Now that she has moved to a Mac (under El Capitan), MIDI in e-mail files appear as playable "audio" files, but only show with 'Error' and cannot be read. I was able to reproduce this problem on my Mac. Here is how to see the MIDI file:

    Is there something that can be done so that my mom can listen MIDI from Mail files without having to open them in Garageband?

    Thanks in advance

    The same problem for me, the midi-files in Mail.app on my desktop Mac are empty. In the mail from my iPad, they are perfect, it seems to me that on my Mac Mail.app damage midi files.

    My short cut for now is to transport the attachments of my iPad via the cloud to my Mac.

  • Problem with Listen.vi Linux TCP

    I have a Linux machine that is configured with two IPS (192.168.0.X), with a physical ethernet taken.  When you run a program on it (using Listen.vi TCP) to connect ethernet to a remote computer, it works fine.  If the program is re-entrant, and I have two of the programs running simultaneously, each with unique IP address and a port number, it still works very well.  If I use the same IP address for both of them, but the unique port numbers, it still works very well.  However, if I use unique IP addresses but the same port number for each of them, I get error 60 (connection already in use).

    For example,.

    192.168.0.11:6000 and 192.168.0.12:6001--> OK

    192.168.0.11:6000 and 192.168.0.11:6001--> OK

    192.168.0.11:6000 and 192.168.0.12:6000--> error 60

    I tried the wiring to the specific IP address in the TCP Listen.vi, nothing helped.

    Any ideas on why this could be implemented?

    Thank you in advance.

    A fix for the problem, after discussing this with an engineer NOR is attached.

  • I was listening to an audio book, and my sound came out, as well as the icon in the taskbar. How can I solve this problem?

    I was listening to an audio book, and my sound came out, as well as the speaker in task bar icon. how it?

    If you listen to the book on your computer you can try to restart the computer to see if that fixes the problem.

  • More than 21 years seen by members of the forum, and no one wants to step up and give "Thank God, a helping hand in setting his problem, so he can listen to religious music? __Cannot the checkbox in Control Panel... fields are grayed out. has tried windo

    After receiving more than 20 views... I guess that PERSON DO want help 'Thank God' by fixing his problem from his computer, so he can listen to his religious music. ???

    Thanks, Hello God

    If you would please provide additional information about you survey, I'd be very happy.

    Please continue with the following support steps listed below...

    -Clean Windows Boot to isolate 3rd party interference

    -Create an another user account and verify if you experience this problem.

    SFC/scannow

    -Disk Cleanup

    -System Restore to a date and time when your computer was functioning normally

    -Fix the Windows Setup (steps are listed below)

    Please proceed to a repair of the OS installation.  In case of failure, please make sure that you back up your data to an external location before performing the repair.  Here are the steps to proceed with the repair.

    To start the repair facility, load Windows 7 and make sure that you are connected to an administrator account. Then, insert the Windows 7 DVD and run the file setup.exe from the menu autoplay:

    Then click install now to start the process:

    Now, uncheck the box "I want to help improve Windows ' and select the optionto go online to get the latest updates for installation :

    The installation process will then search online for available updates, which may take a few moments. Once complete, read the license agreement, then checkthe box I accept and click Next:

    Now, click on the box to upgrade to start the Windows 7 repair facility:

    Windows will then be re - install Windows 7 over itself and you will be informed of its progress as it does. Your PC will reboot a couple of times during this proc

    Once restarted, you are then prompted to enter details of the usual initial installation (for example, the license key, location and time settings). When it is finished, the repair facility was conducted entirely.

    Thank you

    Aaron
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • Listener GPS problem

    Hi people,

    In collaboration with 4.2.1 on the 8800 Simulator.  My application is currently composed of two separate applications, app UI to obtain/view the information and a 'replication' application that communicates with our backend. I want to be able to include location on request of the user data (in the application user interface) and once it is updated, have replication app send it to the server. I have this work especially to my satisfaction, but the following problem: when I close the application user interface, any incomplete GPS please never finished. It seems that my LocationListener is not registered, or maybe the listener Thread is killed the closure of the part of the user interface. I don't expect that the instance is stored in the runtimestore and the object that is saved as the listener is always valid. Here's how I set it up:

    App of the user interface, the following is performed from a menu, click:

                GPSUpdater gps = GPSUpdaterFactory.getGPSUpdater();            gps.getGPSData(row, GPSUpdater.CHECK_IN);
    

    Replication App: (cut a lot of independent code)

    class ReplicationManagerImpl implements LocationListener{    private GPSUpdater mGPSUpdater;
    
        ReplicationManagerImpl()    {        mGPSUpdater = GPSUpdaterFactory.getGPSUpdater();        mGPSUpdater.setListener(this);    }
    
        public void locationUpdated(LocationProvider provider, Location location)    {        mGPSUpdater.newLocationReceived(location);    }
    
        public void providerStateChanged(LocationProvider provider, int newState)    {        //Not worried about this    }}
    

    GPSUpdater:

    public class GPSUpdater{    private Vector mUpdates;    private LocationProvider mProvider;    private Location mLocation;    private LocationListener mListener;    private Boolean isAcquiring;    private int mCounter;
    
        private static final int MAX_RETRIES = 10;    public static final int CHECK_IN = 0;    public static final int CONFIRM = 1;
    
        private static class UpdateData    {        private DataRow suRow;        private int updateType;        private long timeStamp;    }
    
        GPSUpdater()    {        Criteria criteria = new Criteria();        criteria.setHorizontalAccuracy(50);        criteria.setVerticalAccuracy(50);        criteria.setCostAllowed(false);        try        {            mProvider = LocationProvider.getInstance(criteria);            if (mProvider.getState() == LocationProvider.OUT_OF_SERVICE)            {                SubsystemLog.log("GPS actions not supported", EventLogger.ALWAYS_LOG);            }        }        catch (LocationException lEx)        {            SubsystemLog.log("Error creating LocationProvider in GPSUpdater: " + lEx.getMessage(), EventLogger.ERROR);        }        mUpdates = new Vector();        mLocation = null;        isAcquiring = Boolean.FALSE;        mCounter = 0;    }
    
        public void setListener(LocationListener listener)    {        mListener = listener;    }
    
        public void getGPSData(DataRow row, int updateType)    {        long timestamp = System.currentTimeMillis();        if (((mLocation != null) && (mLocation.isValid()) && (mLocation.getTimestamp() > timestamp - 60000)) || (mProvider == null) || (mProvider.getState() == LocationProvider.OUT_OF_SERVICE))        {            UpdateRow(row, updateType, timestamp);        }        else        {            UpdateData update = new UpdateData();            update.row = row;            update.updateType = updateType;            update.timeStamp = timestamp;
    
                synchronized(mUpdates)            {                mUpdates.addElement(update);            }
    
                synchronized(isAcquiring)            {                if (!isAcquiring.booleanValue())                {                    mProvider.setLocationListener(mListener, 5, 5, -1);                    isAcquiring = Boolean.TRUE;                }            }        }    }
    
        public void newLocationReceived(Location location)    {        if ((location == null) || (!location.isValid()) && (mCounter < MAX_RETRIES))        {            mCounter++;            return;        }
    
            mCounter = 0;        mLocation = location;        SubsystemLog.log("Acquired co-ordinates: " + Double.toString(location.getQualifiedCoordinates().getLatitude()) + "," + Double.toString(location.getQualifiedCoordinates().getLongitude()), EventLogger.DEBUG_INFO);
    
            Database db = DataSystemFactory.getDataSystem().openDatabase(DBSchema.NAME);        Object syncObject = db.getSyncObject();
    
            synchronized(syncObject)        {            while (mUpdates.size() > 0)            {                UpdateData update = (UpdateData)mUpdates.elementAt(0);                UpdateRow(update.row, update.updateType, update.timeStamp);                mUpdates.removeElement(update);            }        }        db.commitAndNotify();
    
            synchronized(isAcquiring)        {            provider.setLocationListener(null, -1, -1, -1);            isAcquiring = Boolean.FALSE;        }    }
    
        private void UpdateRow(DataRow suRow, int updateType, long timeStamp)    {        //wrapper class to allow persisting double values        DBDouble latitude = new DBDouble();        DBDouble longitude = new DBDouble();
    
            if (mLocation != null && mLocation.isValid())        {            latitude.setDouble(mLocation.getQualifiedCoordinates().getLatitude());            longitude.setDouble(mLocation.getQualifiedCoordinates().getLongitude());        }        else        {            latitude.setDouble(0.0);            longitude.setDouble(0.0);        }
    
            //store data here    }
    
    }
    

    GPSUpdaterFactory:

    public abstract class GPSUpdaterFactory {    private static final long ID = ;
    
        public static final GPSUpdater getGPSUpdater()    {        Object o;        GPSUpdater gpsUpdater = null;        RuntimeStore runtimeStore = RuntimeStore.getRuntimeStore();        synchronized (runtimeStore)        {            o = runtimeStore.get(ID);            if (o != null)            {                if (o instanceof GPSUpdater)                {                    gpsUpdater = (GPSUpdater)o;                }            }            if (gpsUpdater == null)            {                gpsUpdater = new GPSUpdater();                runtimeStore.put(ID, gpsUpdater);            }        }        return gpsUpdater;            }}
    

    Any suggestions are greatly appreciated.

    Thank you

    Mike

    Notice that the menu close item also called System.exit.

    In this case the application would stop receiving updates following the call of output.  To work around this problem, you can call Application.requestBackground.  This moves the application in the background, where it can continue to operate.  Once you have your final fix application can call System.exit to close itself.

  • Listener Button problem

    This is my first attempt at development for the BB storm, and I use JDE 4.7.

    I started with a Hello World application, I found and I modified to add a simple button that says RED. When you click on I tried the wallpaper turn RED and change the button to say BLUE, when that is clicked on it turns BLUE changes back to RED button again.

    I've implemented this, use a standard listener ButtonField (which I call bhandler in my code). The program type of works, with the odd effect only on the Simulator is that when I click the button, the background color changes but a little menu appears. Anyone else seen this problem of menu? I don't expect to see a menu and I have not coded anything to ask for a menu appear when I click on this button.

    Here is my source code. The Manager is in bold. All the answers that I see not why only a menu would be most appreciated... Thank you.

    /**
    * HelloWorld.java
    * Copyright (C) 2001-2003 research In Motion Limited. All rights reserved.
    */
    package com.rim.samples.helloworld;

    Net.rim.device.api.ui import. *;
    Net.rim.device.api.ui.component import. *;
    Net.rim.device.api.ui.container import. *;
    Net.rim.device.api.system import. *;
    Net.rim.device.api.ui.decor import. *;

    /*
    * BlackBerry applications that provide a user interface
    * must extend UiApplication.
    */
    SerializableAttribute public class HelloWorld extends UiApplication
    {
    Public Shared Sub main (String [] args)
    {
    create a new instance of the application
    and launch the application on the event thread
    HelloWorld APP = new HelloWorld();
    theApp.enterEventDispatcher ();
    }
    public HelloWorld()
    {
    a new screen
    pushScreen (new HelloWorldScreen());
    }
    }

    create a new screen that covers the screen, which provides
    standard behavior by default for BlackBerry applications
    final HelloWorldScreen class extends screen
    {
    public HelloWorldScreen()
    {

    call the constructor of the screen
    Super();

    Add a title to the screen
    LabelField title = new LabelField ("HelloWorld example", LabelField.ELLIPSIS
    | LabelField.USE_ALL_WIDTH);
    setTitle (title);

    Add the text "Hello World!" to the screen
    Add (new RichTextField ("Hello World!"));
                    
    First define the button handler
                    FieldChangeListener bhandler = new FieldChangeListener()
    {
    ' Public Sub fieldChanged (field field, int context)
    {
    ButtonField buttonField = field (ButtonField);
    If (buttonField.getLabel () is 'RED')
    {
    Bottom newback = BackgroundFactory.createSolidBackground (Color.RED);
    getMainManager () .setBackground (newback);
    buttonField.setLabel ("BLUE");
    }
    on the other
    {
    Bottom newback = BackgroundFactory.createSolidBackground (Color.BLUE);
    getMainManager () .setBackground (newback);
    buttonField.setLabel ("RED");
    }
    }
    };

    Define the button itself use Manager above, this one called RED
    ButtonField buttonField = new ButtonField ("RED");     Create a RED button
    buttonField.setChangeListener (bhandler);               Implement the handler for button defined above
                     
    Add (buttonField);  Adds the button to the screen.

    }

    Override the onClose() method to display a dialog to the user
    with "Goodbye!" when the application is closed
    public boolean onClose()
    {
    Dialog.Alert ("Goodbye!");
    System.Exit (0);
    Returns true;
    }
    }

    Solved in Java development.

  • Changing custom field problem Listener

    I created a custom field that works as a button. He painted a bitmap to the screen. And when it focuses it changes the color of the image. However, I try to add a field change listener to it. I looked on the forum and found this code.

    protected boolean navigationClick(int status, int time)
    {
         fieldChangeNotify(1);
         return super.navigationClick(status, time);
    }
    

    It works but I have a problem. You see, my button now push a small screen, thin in the stack that has another button of the same type on it (custom button). At the moment it is the only button on this screen, which means that it has the focus. But it seems that once my button has the focus, I can click anywhere and it is always enabled. I only want to be activated when I touch it. Any suggestions? Here is my code

    public class MenuButtonField extends Field
    {
        Bitmap imagePic;
        Bitmap highlightedPic;
        public MenuButtonField(String imageName, String focusedImg)
        {
            super();
            imagePic=Bitmap.getBitmapResource(imageName);
            highlightedPic=Bitmap.getBitmapResource(focusedImg);
        }
    
        public void layout(int width,int height)
        {
            setExtent(20,80);
        }
    
        public boolean isFocusable()
        {
            return true;
        }
    
        public void drawFocus(Graphics graphics, boolean on)
        {
            paint(graphics);
        }
    
        public boolean touchEvent(TouchEvent message)
        {
            int type=0;
            type=message.getEvent();
            if(type==TouchEvent.CLICK)
            {
                fieldChangeNotify(1);
                return true;
            }
            else{
                return false;
            }
        }
    
        protected boolean navigationClick(int status, int time) {
            fieldChangeNotify(1);
            return super.navigationClick(status, time);
        }
    
        protected void paint(Graphics g)
        {
    
            g.drawBitmap(0, 20, 20, 80, imagePic, 0, 0);
    
            if(this.isFocus())
            {
                g.drawBitmap(0, 20, 20, 80, highlightedPic, 0, 0);
            }
    
        }
    }
    

    PLEASE HELP ME

    I found help here
    http://supportforums.BlackBerry.com/T5/Java-development/navigationClick-invoked-when-clicking-outsid...

    The position of Scribe the Lion was the solution.

  • Problem about the listener, the timer and the timer task

    Hi all

    I create an application that is listening to the incoming call.

    When incoming call arrives that a single clock time is beginning for 1 min.

    If an another incoming call arrives less than 1 min this timer must be handed over to zero and count from the beginning.

    but in my case it not to reset the counter, will launch the counter where it was finally.

    both my variable are static

    any help...

    And what is the status of idel of application if the incoming call is coming.

    application is paused or in working order?

    I suspect that you have other problems, but before we start looking at these, please can you change your "static" variables and use RuntimeStore for these.  static variables are not singletons, except in certain specific circumstances.

    http://supportforums.BlackBerry.com/T5/Java-development/create-a-singleton-using-the-RuntimeStore/TA...

    Another recommendation.  Do as little processing as you can in a listener.  Swap in your own application to perform any significant processing.  Use GlobalEvents to swap in your own application.  Here's the good KB article that will help you to do so.

    http://supportforums.BlackBerry.com/T5/Java-development/global-events-and-global-event-listeners/TA-...

Maybe you are looking for