BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 09-22-2010, 11:12 AM   #1 (permalink)
New Member
SergioTapia's Avatar
Join Date: Aug 2010
Model: 7100T
Carrier: asdfasdf
Posts: 12
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How can I handle a user screen tap on a BitmapField?

Please Login to Remove!

I want to show another screen when a user taps the screen on a picture I put up.

Here is my simple class:

public class SelectYesNoArea extends Manager {

    BitmapField yes;
    BitmapField no;
    DateField date;
    Calendar cal;

    public SelectYesNoArea(long style){

        Bitmap bgPic = Bitmap.getBitmapResource("divBackgrounds.png");
        Background bg = BackgroundFactory.createBitmapBackground(bgPic);

        cal = Calendar.getInstance();               
        date = new DateField("",cal.getTime().getTime(), DateFormat.DATE_SHORT);

        Bitmap bitYes = Bitmap.getBitmapResource("yes.png");
        yes = new BitmapField(bitYes);

        Bitmap bitNo = Bitmap.getBitmapResource("no.png");
        no = new BitmapField(bitNo);
How can I achieve this? I want them to be taken to another screen when he taps the picture. I need help specifically with the click handling part, the screen navigation is secondary at this point. Thanks for the help!
Old 09-22-2010, 01:02 PM   #2 (permalink)
Talking BlackBerry Encyclopedia
Smiley8's Avatar
Join Date: May 2008
Location: Calgary, AB
Model: Torch
Carrier: Fido
Posts: 226
Post Thanks: 0
Thanked 0 Times in 0 Posts

all you do is add a listener to the bitmapfield like this

            yes.setChangeListener( new FieldChangeListener( ) {
                public void fieldChanged( Field field, int context ) {
    // do something
            } );
Visit our website for Cool BlackBerry Apps.

Follow us @
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Copyright 2004-2014
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.