这里是我的代码并且通过源代码不可用异常。在代码中我们需要显示的弹出屏幕,但不显示平均速度的值。
class popUpScreen extends PopupScreen
{
private EditField _sp;
// Speed s = new Speed();
//public double _averageSpeed =s._averageSpeed ;
StringBuffer sb = new StringBuffer();
popUpScreen()
{
super(new VerticalFieldManager(),Field.FOCUSABLE);
Speed s = new Speed();
double _averageSpeed =s._averageSpeed ;
_sp = new EditField(" The Average Speed is: ",""+_averageSpeed );
add(_sp);
//Speed._averageSpeed=sb.;
//sb.append("\n_averageSpeed : ");
//sb.append(_averageSpeed);
}
}
答案 0 :(得分:0)
你应该保存你传递给super的VerticalFieldManager;将您的标签添加到经理。
没有必要覆盖你可以这样做的整个课程:
DialogFieldManager dfm = new DialogFieldManager();
dfm.add(_sp);
PopupScreen popUpScreen = new BasePopupScreen(dfm, Manager.VERTICAL_SCROLL);