當我運行此代碼時,我不斷收到IllegalArgumentException並且沒有在BlackBerry模擬器上顯示。它有什麼問題?需要現場經理幫助黑莓
public MyScreen()
{
// Set the displayed title of the screen and add the weather icons
setTitle("PixWeather");
cityField = new LabelField("Queensland", Field.FIELD_LEFT);
tempField = new LabelField("17", Field.FIELD_RIGHT);
condField = new LabelField("sunny",Field.FIELD_RIGHT);
weather_icon = Bitmap.getBitmapResource("sun_icon.png");
bitmapField = new BitmapField(weather_icon, Field.FIELD_LEFT);
VerticalFieldManager vfield = new VerticalFieldManager();
HorizontalFieldManager hfield1 = new HorizontalFieldManager();
hfield1.add(cityField);
hfield1.add(tempField);
HorizontalFieldManager hfield2 = new HorizontalFieldManager();
hfield2.add(bitmapField);
hfield2.add(condField);
vfield.add(hfield1);
vfield.add(hfield2);
}
第1步是找出哪裏IllegalArgumentException拋出。做一些調試來弄清楚,然後用你的發現來更新這個問題。 –