05-11-2011 01:35 AM
Hi
I am using BitmapField as a button with both FieldChangeListener and
FocusChangeListener in my app.
In FocusChangeListener I am just changing image of bitmapfield
and in FieldChangeListener i gave one action.
Problem is when BitmapField gained focus, FieldChangeListener gets invoked
What could be the solution to prevent this?
I want action to be invoked only on Click and not on FOCUS_GAINED event
Solved! Go to Solution.
05-11-2011 01:53 AM
Hi,
Instead of Field change listener try with 'navigation on click ' method.....
--------------------------------------------------
press 'Kudos' if it helps
05-11-2011 02:06 AM
Hi,
try this code
BitmapField bmpField = new BitmapField(bitmap, BitmapField.FOCUSABLE){
protected void drawFocus(Graphics graphics, boolean on){
//the simplies way to draw a rectangle and this will be the focus
}
protected boolean navigationClick(int status, int time)
{
//write here your code what you want to run the user clicks to the bitmap
//try something like this
UiApplication.getUiApplication().pushScreen(new MyScreen());
return true;
}
};
--------------------------------------------------
feel free to press the kudos button
on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
05-11-2011 04:36 AM
05-11-2011 05:51 AM
Thanx all of you
Everybody's solution is working for me..