当我尝试基于ObjectID查询parse.com对象时,我总是得到stackoverflowexception。有没有其他人这个问题或有任何解决方法,以避免此异常?
(我尝试过不同版本的SDK,不同的parse.com帐户 - 但异常仍然存在)
任何帮助将不胜感激:)
重现的步骤:
1)下载示例android启动项目
2)使用eclipse作为现有项目导入
3)在ParseApplication.java中填写app ID
4)修改ParseStarterProjectActivity.java的onCreate方法:
在ParseAnalytics.trackAppOpened(getIntent())之后; row添加一个简单的查询,直接来自文档:
ParseQuery<ParseObject> query = ParseQuery.getQuery("GameScore");
query.getInBackground("xWMyZ4YEGZ", new GetCallback<ParseObject>() {
public void done(ParseObject object, ParseException e) {
if (e == null) {
// object will be your game score
} else {
// something went wrong
}
}
});
5)在设备上运行并等待几秒钟(最多5-10)
6)结果:Stackoverflowexception
12-07 13:40:27.298:I / dalvikvm(690):threadid = 1:堆栈溢出,调用Lcom / parse / starter / ParseStarterProjectActivity $ 1; .done:VLL
12-07 13:40:27.298:I / dalvikvm(690):方法需要12 + 20 + 12 = 44字节,fp是0x410aa30c(左12)
12-07 13:40:27.298:I / dalvikvm(690):扩展堆栈结束(0x410aa300到0x410aa000)
12-07 13:40:27.298:I / dalvikvm(690):缩小堆栈(至0x410aa300,curFrame为0x410ace20)
12-07 13:40:27.298:D / AndroidRuntime(690):关闭VM
12-07 13:40:27.298:W / dalvikvm(690):threadid = 1:线程退出未捕获异常(组= 0x40015560)
12-07 13:40:27.378:D / dalvikvm(690):GC_CONCURRENT释放307K,50%免费3050K / 6023K,外部410K / 517K,暂停2ms + 1ms
12-07 13:40:27.418:D / dalvikvm(690):GC_FOR_MALLOC释放284K,50%免费3130K / 6215K,外部410K / 517K,暂停14ms
12-07 13:40:27.428:E / AndroidRuntime(690):致命异性:主要
12-07 13:40:27.428:E / AndroidRuntime(690):java.lang.StackOverflowError
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
12-07 13:40:27.428:E / AndroidRuntime(690):at com.parse.starter.ParseStarterProjectActivity $ 1.done(ParseStarterProjectActivity.java:1)
附加说明:
答案 0 :(得分:0)
尝试使用findinbackground
ParseQuery<ParseUser> query = ParseUser.getQuery();
query.whereNotEqualTo("application", null);
query.whereContains("application", "My App");
query.findInBackground(new FindCallback<ParseUser>() {
@Override
public void done(List<ParseUser> users, ParseException e) {
}});