I have created a ButtonField & a BitmapField like..
public class MyCanvas extends MainScreen implements FieldChangeListener
{
HorizontalFieldManager hfm;
private Bitmap startBitmap;
private BitmapField startBitmapField;
private ButtonField okButton;
MyCanvas()
{
hfm = new HorizontalFIeldManager();
startBitmap = Bitmap.getBitmapResource("start.png");
startBitmapField = new BitmapField(startBitmap);
startBitmapField.setChangeListener(this);
hfm.add(startBitmapField);
okButton = new ButtonField("Ok", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY);
okButton.setChangeListener(this);
hfm.add(okButton);
}
public void fieldChanged(Field field, int context)
{
if(field == startBitmapField)
{
System.out.println("Touched START...");
}
else if(field == okButton)
{
System.out.println("Touched Ok...");
}
}
}
But the ButtonField or BitmapField click is not happening in Blackberry 4.7 simulator.
I want to build it for Blackberry Storm so I m using Blackberry 4.7
How to handle click/touch events for ButtonField & BitmapField for Blackberry Storm?