问题
can anyone help me for solving the below question. I am making an application for blackberry in that from one bitmapField i have to invoke a new screen by clicking on the bitmapField. I want the code for the same... how to invoke a new screen by clicking on a bitmapField... and i am using blackberry JDE 4.7
回答1:
Try making the BitmapField focusable
BitmapField bm = new BitmapField(bitmap, BitmapField.FOCUSABLE);
This might help
回答2:
BitmapField bmpField = new BitmapField(bitmap, BitmapField.FOCUSABLE)
protected boolean navigationClick(int status, int time)
{
if(bmpField.isFocus)
{
UiApplication.getUiApplication().pushScreen(new MyScreen());
}
return true;
}
}
i have used on a Storm and it works.
If even this does not work, u can go ahead and use touchEvent
instead of navigationClick
回答3:
This must work
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;
}
}
来源:https://stackoverflow.com/questions/2145163/blackberry-invoke-a-click-event-on-bitmap-field