我正在尝试在BlackBerry jde 5.0.0.14版本上构建付款申请。当我调试代码时,PaymentEngine对象始终为null。为什么会这样?我的代码有问题吗?
private PaymentEngine engine = PaymentEngine.getInstance();
public PurchaseDemoScreen()
{
setTitle("Payment Service SDK Demo");
if (engine != null)
{
engine.setConnectionMode(PaymentEngine.CONNECTION_MODE_LOCAL);
//do shopping
}
else
{
//in-app purchase unavilable
}
}
答案 0 :(得分:0)
您安装了哪个版本的BlackBerry App World?
PaymentEngine.getInstance()
如果BlackBerry设备未安装BlackBerry App World 2.1或更高版本,则会返回null。