我在我的應用程序中有兩種方法,即希望一個接一個執行。使用Java線程的異步調用
removeAllNonSyncedData();
getFullDbFromREST();
第一種方法是removeAllNonSyncedData()
它從db中刪除所有非同步數據。
當所有數據被清除,我想執行getFullDbFromREST()
private void removeAllNonSyncedData() {
try {
ContentResolver cr = getContentResolver();
ContentProviderHelp helper = new ContentProviderHelp();
ObjectPropertyValueTable ObjectPropertyValueTable = new ObjectPropertyValueTable(helper);
ObjectPropertyValueAuditTrailTable ObjectPropertyValueAuditTrailTable = new ObjectPropertyValueAuditTrailTable(helper);
PhotoInfoTable PhotoInfoTable = new PhotoInfoTable(helper);
PropertyDefinitionTable PropertyDefinitionTable = new PropertyDefinitionTable(helper);
SyncManagerTable SyncManagerTable = new SyncManagerTable(helper);
cr.delete(ObjectPropertyValueTable.getContentURI(), ObjectPropertyValueTable.SyncStatus+"<>1", null);
cr.delete(ObjectPropertyValueAuditTrailTable.getContentURI(), null, null);
cr.delete(SyncManagerTable.getContentURI(), null, null);
cr.delete(PhotoInfoTable.getContentURI(), PhotoInfoTable.SyncStatus+"<>1", null);
} catch (Exception e) {
e.printStackTrace();
}
}
我如何可以執行第二種方法第一種方法是進行(從數據庫中完全清除數據)之後?