If we use the following sample code for the following handlers:
Business Logic - Geo Service Handler - beforeAddCategory()、 afterAddCategory()、 beforeDeleteCategory()、 afterDeleteCategory()
public boolean geoAddCategorySync(final String categoryName) {
mRet = false;
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
GeoCategory category = Backendless.Geo
.addCategory(categoryName);
if (category.getName().equals(categoryName))
mRet = true;
else
mRet = false;
} catch (Exception e) {
Log.e(TAG, e.toString());
mRet = false;
}
}
});
try {
thread.start();
thread.join();
} catch (Exception e) {
e.printStackTrace();
}
return mRet;
}
The correct invokation order is beforeAddCategory() and then afterAddCategory() but now we find that after beforeAddCategory() the method afterDeleteCategory() is mistakenly being called.