나는 두 Parse.com 쿼리를 만들고 있었다 ..CountDownLatch는 두 개의 Parse 쿼리와 함께 사용됩니까?
ABC.findInBackground(new FindCallback<ParseObject>()
{
...
}
DEF.findInBackground(new FindCallback<ParseObject>()
{
...
}
나는 본질적으로 노력이 일을 물론
CountDownLatch waitForBoth = new CountDownLatch(2);
ABC.findInBackground(new FindCallback<ParseObject>()
{
...
waitForBoth.countDown();
}
DEF.findInBackground(new FindCallback<ParseObject>()
{
...
waitForBoth.countDown();
}
// (error handling (just a flag) not shown)
waitForBoth.await();
Log("both are finished yay!");
, 난 그냥 잡다한 오류를 예외 : IllegalMonitorStateException를 얻을 : 스레드에 의해 잠겨 있지 객체 전에() 등 기타
나 이외의 문제는 밀도가 높습니다. 파스의 findInBackground에 대한 호출은 입니다. 사실, 어쨌든 새 스레드에서 벗어나 잖아? 기록을 위해
은, 구문 분석 호출 그 중 하나는, 다음과 같이
ParseQuery<ParseObject>PQ = ParseQuery.getQuery("SomeTable");
PQ.whereEqualTo("SomeColumn", ParseUser.getCurrentUser());
PQ.include("SomeOtherColumn");
PQ.findInBackground(new FindCallback<ParseObject>()
{
@Override
public void done(List<ParseObject> res, ParseException e)
{
if (e == null)
{
// res is the List of ParseObject results from the cloud
// here, you'd basically...
waitForBoth.countDown();
}
else
{
int errCodeSimple = e.getCode();
exampleWoeFlag = false;
waitForBoth.countDown();
}
}
});
}
그에 DOCO 보이는 ...
http://parse.com/docs/android/api/com/parse/ParseQuery.html#findInBackground(com.parse.FindCallback)