PaymentEngine 对象始终为 null
我正在尝试在 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
}
}
I am trying to build a payment appication on BlackBerry jde version 5.0.0.14. When I debug the code, PaymentEngine object is always null. Why does this happen? Is there any fault in my code?
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
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您安装了哪个版本的 BlackBerry App World?
如果 BlackBerry 设备未安装 BlackBerry App World 2.1 或更高版本,则返回 null。
What version of the BlackBerry App World do you have installed?
does return null if the BlackBerry device does not have BlackBerry App World 2.1 or higher installed.