headset with custom not getting class not called...

Hi all

I expanded the customclass with the field. I drew a rectangle rounded in it. now, I want that the listener must get called when I click on the rectangle and the dialog box should appear. I managed the setchangelistener, but of no use. Here is my code...

package com.samples;

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.Dialog;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;

public class CustomPaintingScreen extends MainScreen implements FieldChangeListener
{
    public CustomPaintingScreen()
    {
        setTitle("Custom Painting ");
        CustomClass cstmcls = new CustomClass();
        cstmcls.setChangeListener(this);
        add(cstmcls);
         }

    public void fieldChanged(Field field, int context)
    {
        if(field instanceof CustomClass)
        {
            Dialog.alert("clicked");
        }
    }
}
-----------------
package com.samples;

import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYRect;

public class CustomClass extends Field
{
    protected void layout(int width, int height)
    {
        height = getFont().getHeight()* 8;
        setExtent(Display.getWidth(), height);
    }

    protected void paint(Graphics graphics)
    {
        graphics.setColor(0xFF7F24);
        graphics.fillRoundRect(5, 5, (getWidth()-10), (getFont().getHeight()*5), 30, 40);
    }
}

When the rounded rectangle is clicked I want to display the alert message.

The essential code in this post is as follows:

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

Tags: BlackBerry Developers

Similar Questions

  • Class derived from LabelField with custom font color, but when focus not only

    Hello

    I have some problems with the LabelField-derived class. I want it has customized color background and police, but only when it does not have focus.

    I tried to do the following:

    protected void paint(Graphics g) {
        if (isFocus()) {
            super.paint(g);
        }
        else {
            final int bgColor = g.getBackgroundColor();
            final int fgColor = g.getColor();
    
            g.setBackgroundColor(backgroundColor);  // from member
            g.setColor(fontColor);  // from member
    
            super.paint(g);
    
            g.setColor(fgColor);
            g.setBackgroundColor(bgColor);
        }
    }
    

    but the final effect is that this field has the custom until the first focus/unfocus font color. When I do not check the isFocus(), police have custom color when the field has focus too.

    Similar do in drawFocus (Graphics g, boolean on) does not solve the problem either.

    I target BB > = 4.6.0.

    Do you know how to do properly without calls drawText custom?

    Kind regards

    Piotr

    What happens if you replace

    If (isFocus())

    with

    If (g.isDrawingStyleSet (Graphics.DRAWSTYLE_FOCUS))

    and (maybe - I'm totally guessing here) substitute drawFocus doing nothing?

    BlackBerry GUI has many peculiarities, so you never know what path is right.

    A word of caution: most likely, you will have also to invalidate() field when it changes its "focused" State Don't do this in onFocus() / onUnfocus()! Those (especially the onUnfocus()) are not always correctly called (BB frame problem). Make your field implement FocusChangeListener and make these invalidations in the method focusChanged() (using setFocusListener (this) somewhere in the constructor).

  • Why getter VO is not called for custom attributes of VO?

    Hello

    The requirement is to add two or three fields on a page of the OFA. Here's what I did:

    -Created VO personalized by extending the standard VO
    -Added fields to the page through customization.

    The problem is that the values for the custom page fields were not. Investigation, I found that the accessor Get of VORowImpl getAttrInvokeAccessor was not called for my custom attribute. I tried to check the difference between the attributes for which the Get accessor is called, and for whom it has not named. I could not find and I'm totally clueless as to what determines the get accessor to be called.

    Really appreciate your help to move forward.

    Thank you
    Anil

    Published by: AnilMenta on March 5, 2013 10:40

    Hi Anil,
    Unless the attribute is not used in the user interface or other calls,
    the Get accessor will be called
    Make sure you've got the attribute used to get your custom attribute named getter.

    You mentioned that you started to use in customization, it is always the problem persists?

    Thank you

    With respect,
    Kali.
    OSSi.

  • AppModuleImpl methods of the class returns the custom class types, not called.

    Hi all

    Methods of the class AppModuleImpl custom types of class, not called when you access through back links.

    OperationBinding operationBinding = bindings.getOperationBinding("getInstanceNameO"); where 'getInstanceNameO' is a method AppModuleImpl returns a class serializable type.

    Any help will be appreciated.

    OI_testBean.goInstanceName_methodCallNew (OI_testBean.Java:99): this line is the call of method appmoduleimpl: OperationBinding operationBinding = bindings.getOperationBinding("getInstanceNameO");

    Looks like 'bindings' is null.

    How to retrieve variable 'bindings '?

    Where is the OI_testBean.goInstanceName_methodCallNew () method called?

    If this method is called from the method call activity, you create pageDef in his name and add getInstanceNameO

    Dario

  • C++ class destructor not called on request nearby

    I started playing with waterfall and C++ development but im having a problem where I can link my class to the qml and use breast but firm request the something on my class hangs the request and its icon in the emulator will slightly transparent and can no longer be clicked.

    It's the call to add it to the qml

    File: Applicationui.cpp
    
    ApplicationUI::ApplicationUI(bb::cascades::Application *app): QObject(app){ // create scene document from main.qml asset // set parent to created document to ensure it exists for the whole application lifetime QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
    
    //My classGpsCommunicator* gps = new GpsCommunicator();
    
    //Add the Classqml->setContextProperty("_gps",gps);
    
    // create root object for the UI AbstractPane *root = qml->createRootObject();
    
    // set created root object as a scene app->setScene(root);
    }
     
    

    Here is the class.hpp

    
    class GpsCommunicator : public QObject {
    Q_OBJECT
    
    Q_PROPERTY(double latitude READ latitude) Q_PROPERTY(double longitude READ longitude) Q_PROPERTY(double accuracy READ accuracy) Q_PROPERTY(double altitude READ altitude) Q_PROPERTY(double heading READ heading) Q_PROPERTY(double satellites READ satellites) Q_PROPERTY(double speed READ speed)
    Q_PROPERTY(bool isRegistered READ isRegistered) Q_PROPERTY(bool isAltitudeValid READ isAltitudeValid) Q_PROPERTY(bool isAccuracyValid READ isAccuracyValid) Q_PROPERTY(bool isHeadingValid READ isHeadingValid) Q_PROPERTY(bool isSpeedValid READ isSpeedValid)
    public: GpsCommunicator(QObject *parent = 0); virtual ~GpsCommunicator();
    //Latitude Property double latitude();
    //Latitude Property double longitude();
    //Accuracy Property double accuracy(); bool isAccuracyValid();
    //Altitude Property double altitude(); bool isAltitudeValid();
    //Heading Property double heading(); bool isHeadingValid();
    //Speed Property double speed(); bool isSpeedValid();
    //Number of Satellite Property double satellites();
    //Registered successfully to geolocation events bool isRegistered();
    Q_INVOKABLE void StartPollTimer(int i = 0); Q_INVOKABLE void StopPollTimer();
    signals:
    
    private:
    //Bool to track if this class is registered to receive geo-location events bool m_isRegistered;
    double m_latitude; double m_longitude; double m_accuracy; bool m_accuracy_valid; double m_altitude; bool m_altitude_valid; double m_altitude_accuracy; bool m_altitude_accuracy_valid; double m_heading; bool m_heading_valid; double m_speed; bool m_speed_valid; double m_num_satellites; bool m_num_satellites_valid;
    void InitializeGps(); void InitializeCommunicator();
    //Poll timer QTimer *pollTimer;
    
    public slots:
    void CheckForGPSEvent();
    };
     
    

    Here is the .cpp for her

    
    GpsCommunicator::GpsCommunicator(QObject *parent): QObject(parent) { //Start up sequence this->InitializeCommunicator(); this->InitializeGps();}
    void GpsCommunicator::InitializeCommunicator() { this->m_isRegistered = false;}
    GpsCommunicator::~GpsCommunicator() { // TODO Auto-generated destructor stub this->StopPollTimer(); delete this->pollTimer; geolocation_stop_events(0); bps_shutdown();}
    double GpsCommunicator::latitude() { return this->m_latitude;}
    double GpsCommunicator::speed() { return this->m_speed;}
    double GpsCommunicator::altitude() { return this->m_altitude;}
    double GpsCommunicator::longitude() { return this->m_longitude;}
    double GpsCommunicator::accuracy() { return this->m_accuracy;}
    double GpsCommunicator::heading() { return this->m_heading;}
    double GpsCommunicator::satellites() { return this->m_num_satellites;}
    bool GpsCommunicator::isRegistered(){ return this->m_isRegistered;}
    bool GpsCommunicator::isSpeedValid() { return this->m_speed_valid;}
    bool GpsCommunicator::isAccuracyValid() { return this->m_accuracy_valid;}
    bool GpsCommunicator::isAltitudeValid() { return this->m_altitude_valid;}
    bool GpsCommunicator::isHeadingValid() { return this->m_heading_valid;}
    void GpsCommunicator::StartPollTimer(int i) { this->pollTimer->start(i);}
    void GpsCommunicator::StopPollTimer() { this->pollTimer->stop();}
    void GpsCommunicator::InitializeGps() {
    if( bps_initialize() != BPS_FAILURE) { if ( geolocation_request_events( 0 ) != BPS_SUCCESS ) { //Report that the initialize failed this->m_isRegistered = false; //emit this->registeredChanged(this->m_isRegistered); } else { geolocation_set_period(1);
    //Update that the communicator is now registered and emit the signal this->m_isRegistered = true; //emit this->registeredChanged(this->m_isRegistered);
    //Create the timer instance this->pollTimer = new QTimer();
    //Connect it to the polling function this->connect(this->pollTimer, SIGNAL(timeout()), this, SLOT(CheckForGPSEvent())); this->StartPollTimer(100); } }}
    void GpsCommunicator::CheckForGPSEvent() {
    bps_event_t *event = NULL; bps_get_event(&event, 100); // -1 means that the function waits // for an event before returning if (event) {
    if (bps_event_get_domain(event) == geolocation_get_domain()) {
    if (event == NULL || bps_event_get_code(event) != GEOLOCATION_INFO) { return; }
    // TODO: change this so the emit is only called if the information is new
    this->m_latitude = geolocation_event_get_latitude(event); //emit this->latitudeChanged(this->m_latitude);
    this->m_longitude = geolocation_event_get_longitude(event); //emit this->longitudeChanged(this->m_longitude);
    this->m_accuracy = geolocation_event_get_accuracy(event); //emit this->accuracyChanged(this->m_accuracy);
    this->m_altitude = geolocation_event_get_altitude(event); //emit this->altitudeChanged(this->m_altitude);
    this->m_altitude_valid = geolocation_event_is_altitude_valid(event);
    this->m_altitude_accuracy = geolocation_event_get_altitude_accuracy(event);
    this->m_altitude_accuracy_valid = geolocation_event_is_altitude_accuracy_valid(event);
    this->m_heading = geolocation_event_get_heading(event); //emit this->headingChanged(this->m_heading);
    this->m_heading_valid = geolocation_event_is_heading_valid(event);
    this->m_speed = geolocation_event_get_speed(event); //emit this->speedChanged(this->m_speed);
    this->m_speed_valid = geolocation_event_is_speed_valid(event);
    this->m_num_satellites = geolocation_event_get_num_satellites_used(event); //emit this->satellitesChanged(this->m_num_satellites);
    this->m_num_satellites_valid = geolocation_event_is_num_satellites_valid(event); } }
    return;}
    

    I was checking to see if the deconstructor was called, but it doesn't seem to be. So I think it might be the QTimer not cleaned but I don't know how I get it to call on family members since I thought that once I signed with qml my QObject class would be deconstructed with other resources in a certain order.

    Thanks in advance for any help

    Do not call bps_get_event from an application of stunts that you might fly the main event loop events.  Rather implement AbstractBpsEventHandler to the BPS events delivered on the thread of your event.

  • Pages of the OPS (with custom controller) does not not in the R 12.2.4 upgrade custom

    Hi all

    There is a problem, I'm dealing with my custom page. I am trying to expand the controller with my custom class, but get the error below

    oracle.apps.fnd.framework.OAException: could not create Java class: (oracle.apps.xxar.cusstd.createcus.webui.xxArCreCusCO) associated with the area: (ArUtilRN). It is probably because the class name is incorrect or not included in the project.

    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1247)

    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(OAPageErrorHandler.java:1435)

    at oracle.apps.fnd.framework.webui.OAPageBean.processRequest(OAPageBean.java:2848)

    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1991)

    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:567)

    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:455)

    If the file is present in the right folder

    [webui applmgr@gfs3devapp1] $ pwd

    / opt/oracle/gfs2d/FS1/EBSapps/COMN/java/classes/Oracle/Apps/xxar/cusstd/createcus/WebUI

    [webui applmgr@gfs3devapp1] $ ls - ltr

    Total 4

    -rw - r-. 1 applmgr oinstall 1177 Feb 25 10:17 xxArCreCusCO.class

    I have to follow this discussion, but is not help me: https://community.oracle.com/thread/3647610

    Please help.

    Thanks, Jerome

    Hello samia,.

    In R12.2.4, you will need to create the jar with custom classes. Please visit the Doc ID 1577661.1

    Hope this helps you solve your problem.

  • I've recently updated my firefox to my laptop. No longer can I do a search with Google without getting a message that the address of the site/is not secure. How to cancel?

    I've recently updated my firefox to my laptop. No longer can I do a search with Google without getting a message that the address of the site/is not secure. How to cancel? The only search that allows me to see whatever it is is Yahoo that I prefer not to use. In addition, I have to click through a series of tabs to make sure that I know that Yahoo does not feel that the site is secure before it connects. I must tell you that I have strongly dislikes this upgrade and want to return to the old Firefox.

    What is you receive the exact error message? Did you check your date and time? Refreshed Firefox? Refresh Firefox – reset the parameters and modules

  • I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    BabsMKE wrote:

    I get all my calls on my iphone 5.  It sounds at the end of the appellant, but it does not sound on my end and I do not get a past the call.  If the caller leaves a message, and then I get a voice message notification.

    settings - do not disturb - off

  • With the help of 5s with ios 9.2.1. Call ringtone but screen does not show the answer since mode. Could not receive call and not able to see the contact call. This may be due to whatsapp.

    With the help of 5s with ios 9.2.1. Call ringtone but screen does not show the answer since mode. Could not receive call and not able to see the contact call. This may be due to whatsapp bug. Please specify.

    bjmrao wrote:

    With the help of 5s with ios 9.2.1. Call ringtone but screen does not show the answer since mode. Could not receive call and not able to see the contact call. This may be due to whatsapp bug. Please specify.

    Please ask Whatapps since you use their app.

  • I want my phone to ring when I get a phone call, but not ring when I get a text message.

    My phone is ringing when I get an SMS and it sounds when I get a phone call. I want to know if I can have my phone not ring or vibrate when I get a text Message, only to ring when I get a phone call.

    So, I want to:

    message text: no ring

    phone call: ring

    Thank you!

    very simple. Go to Configuration - notifications - messages - disable alert sounds

    or

    Definition of go - Sound - text alerts - set to zero

  • Programatically register values of control only works with Ctrl Val.Get all (not recommended)

    Hello

    I just downloaded "programmatically save 86 vi of https://decibel.ni.com/content/docs/DOC-3551 control values.

    This works.  In the recording, but there an invoke with Ctrl Val.Get All (deprectated) node structure of the event.  I thought that I would get rid of the obsolete reselecting the control method get all.  Of course it was more an (outdated) at the end and the top of the page, little changed from pink to yellow.  However when I run and load a file that is saved I get: error 116 took place to Unflatten chain... Possible reasons:

    LabVIEW: Unflatten or stream of bytes read operation was in pain due to corrupted, unexpected or truncated data.

    A few questions:

    If I were writing this thing without having to download the example it wouldn't work.  Any ideas how I would work in LabVIEW 2011?

    The example is quite old, people would use another method of loading and storage of the parameters in a VI these days?

    This VI crashes after a while.  Is it because he has two event Structures in a loop or because there is no case of timeout or what? (I am not really concerned about why it crashes but if someone knows the answer without wasting time running it I'd appreciate it)

    Thanks for the tips, things that I can draw from this

    The old ways worked with a data type that was {name, type descriptor, flattened data}. The use of new methods {name, variant}, to adapt the code to work with this data type. Also, you cannot use the old data with the new code files.

    I'm assuming that the VI is lock because you have two structures of event in a loop simple (it would make sense, since each structure must wait for an event is to occur), but I'm not the code itself, I can't be sure.

    With respect to the other options, I generally without saving all the controls on a front panel, but when I want to record a bunch of controls, I usually use something like this, which can also work if you collect all the controls of the FP. There are also links to other similar things in the more 'like this' section with the page.

  • during startup, I get an error message. Your SQL server installation is either corrupt or has been tampered with (could not open SQLEVN70. RLL) how to solve this problem?

    during startup, I get an error message.  Your SQL server installation is either corrupt or has been tampered with (could not open SQLEVN70. RLL) how to solve this problem?

    Thank you for visiting the Microsoft answers community.

    The question you have posted is associated with MS SQL server and would be better suited to the Group Discussion TechNet Microsoft. Please visit this link to find a community that will provide the support you want.

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

  • Headset with Microphone plugged in but not detected

    Recently, my brother got a Philips SHM7410U Philips PC Headset with Microphone and tried to make it work for him. It's probably 'plug and play' as it came with no instructions except that. It is plugged in, but my computer does not detect the microphone or headset. The headphones are not listed in the playback devices, and while the microphone is listed, it is said that it is not plugged. They are certainly in the right decision. Not too knowledgeable in the resolution of this type of problem and could use some help.

    Hi Genae,

    I thank you for your message and gives us a chance to help you. I see that you can not use the headphones and the microphone.

    The headphones and the microphone work on another computer?

    You can follow these methods to check whether the problem is resolved.

    Method 1: Run the hardware troubleshooting tool.
    Follow the steps in this link
    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Method 2: Select the default values of the device
    (a) click on 'Start', then 'Control Panel '.
    (b) click on 'hardware and sound '.
    (c) Under sound, click "manage audio devices.
    (d) click on the playback device you want to output sound.
    (e) click set default.
    (f) do the same for the microphone and then click OK

    Method 3: Updated drivers

    You can follow the steps in this link to update the drivers.

    http://Windows.Microsoft.com/en-us/Windows/no-sound-help#no-sound=Windows-7&V1H=win8tab1&V2H=win7tab2&V3H=winvistatab1&v4h=winxptab1

    For more information.

    http://www.P4C.Philips.com/cgi-bin/cpindex.pl?CTN=SHM7410U%2F10&DCT=FAQ&faqview=1&new_tmpl=1&refdisplay=PCHEADSET_QAC_63472&refnr=0063472&scy=SA&SLG=AEN

    If the headphones do not work on another computer, contact the manufacturer.

    Feel free to use the forum for any other issue of Windows, you may have.

  • E-mails are with incredimail, to get ok. will not go. Then the Outbox disappears altogether

    E-mails are with incredimail, to get ok. will not go. Outbox then completely disappears. I need lots of help. Please

    Hello

    Thank you for your message. It seems that there is a problem with your IncrediMail.

    Help about the software, you will need to contact help here http://www.incredimail.com/english/help/support.aspx

    Feel free to use the forum for any other issue of Windows, you may have.

  • Why can I not use a headset with my new laptop Asus?

    I recently bought an ASUS laptop, and I wanted to use a headset with it.

    However, I came across the problem that it is a single dose used for headset and microphone, but apparently not the two.

    Every time I plug something into it, a pop up comes up asking if his headphones, speakers or a headset. I clicked on helmet thinking it would take the microphone, but however he played its just and has not used the microphone.

    Just for my problem, headphones details usually come with two jacks, one for mic for the headphones. Usually laptops meet this and have two jacks, but not this one.

    It would be great if anyone can inform me if its possible to use my headset with microphone and headphones at the same time with my computer.

    Most often when a device does not work, it is because the driver is damaged. Re-install a new copy should help

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly? SignedIn = 1

Maybe you are looking for