initWithAppID 命令崩溃
我是 Android 编程新手,尤其是 PayPal。我有一个负责进行故障排除的应用程序 - 尽管是 Android 新手,但在这一行崩溃了:
initWithAppID(this.getBaseContext(), appID, PayPal.ENV_SANDBOX);
首先,PayPal .ENV_SANDBOX
总是返回 0,我不确定它是否应该返回。其次,为什么总是崩溃?我在网上搜索了原因,人们说是因为它没有完全初始化,这就是它失败的原因。现在我想知道如果我无法初始化这个库我需要做什么?
我正在使用 Eclipse IDE,在 Samsung Galaxy Tab Android 2.2 上进行测试
I am new with Android programming and especially with PayPal. I got an application that was tasked to troubleshoot - despite being new to Android, is crashing at this line:
initWithAppID(this.getBaseContext(), appID, PayPal.ENV_SANDBOX);
Firstly, PayPal.ENV_SANDBOX
always returns a 0 which I am not sure if its suppose to. Secondly, why is it always crashing there? I have searched online for the reason, people says its because it did not fully initialized thats why its failing. Now I would like to know what I need to do if I cant initialize this library?
I am using Eclipse IDE, testing on a Samsung Galaxy Tab Android 2.2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不知道这是否有帮助,但这就是我在使用 PayPal.ENV_NONE 进行测试时修复它的方法(来自 https://github.com/phonegap/phonegap-plugins/blob/master/Android/PayPalPlugin/src/com/phonegap/plugin/mpl.java)
然后在创建按钮时:
希望能有所帮助
Don't know if this will help but this is how I fixed it while testing with PayPal.ENV_NONE (from https://github.com/phonegap/phonegap-plugins/blob/master/Android/PayPalPlugin/src/com/phonegap/plugin/mpl.java)
Then when creating the button:
Hope that helps somehow
您能否指定有关此方法的更多信息?这是贝宝库方法吗?
我认为 PayPal.ENV_SANDBOX 是您必须设置的一些环境变量。顾名思义,此设置用于测试目的或用于开发(实际上不进行任何付款)。
我想您可能会在库文档中找到有关此方法的更多信息。
第二个问题是,你使用了正确的appId吗?基本上下文是正确使用的上下文吗?也许您必须使用 getApplicationContext,请参阅此处 和此处。
Can you specifiy more information about this method? Is it a paypal library method?
I think the PayPal.ENV_SANDBOX is some environment variable you have to set. The name suggests that this settings is used for testing purposes or for developing (not actually doing any payments).
I think you might find out more about this method in the library documentation.
A second question is, have you used the right appId? And is the base context the right context to use? Maybe you have to use the getApplicationContext, see here and here.