Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Super Contributor
yogesh1984
Posts: 308
Registered: ‎05-31-2011
My Device: Blackberry-SDK-9800

click event on bitmapfield

hello everybody,

         i am developing the application where i need to click on calender image to display a calander.....

can anybody tell me how to use click event on image.... i am using OS 6. and torch simulator.

 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: click event on bitmapfield

overwrite navigationclick
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
johanguzman07
Posts: 102
Registered: ‎07-26-2011
My Device: Not a blackberry user

Re: click event on bitmapfield

Greetings.

 

As Simon said, you have to overwrite the navigation click method as the following:

 

BitmapField bitmapField = new BitmapField() {
	protected boolean navigationClick(int status, int time) {
		// What you want to happen if bitmapField is clicked.
		// The two possible status are 
		// KeypadListener.STATUS_FOUR_WAY or KeypadListener.STATUS_TRACKWHEEL
		return true; //this says you handled the event
	}
};

 

I hope this be helpful.


Let me know if this was helpful or if you have a solution.

Johan Guzmán - In case my answer pleased you, give a press to the LIKE button, please!! Mark this post as solution if it solved your problem.
Contributor
ksg1ajel
Posts: 46
Registered: ‎07-07-2011
My Device: 9800

Re: click event on bitmapfield

 bmf= new BitmapField(bitmap,BitmapField.FOCUSABLE){
        	protected boolean navigationClick(int status, int time)
        	{
        	try{
        		// do your Operations
        	}
        	catch(Exception e) {
        	e.printStackTrace();
        	}
        	return true;
        	}
        };

 use the above code and at the same tome add NullField object to the layout.