Commit 9dde565e by Kunj Gupta

Fixed - We need to get updated data from server each time.

parent 254ec802
......@@ -86,15 +86,15 @@ public class CatalogueItemScreen extends AppCompatActivity {
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
List<CatalogueItem> catalogueItemList = CatalogueItemManager.getAllCatalogueItems(mCatalogue.getId());
if(catalogueItemList.isEmpty()) {
if(application.isNetConnected()) {
new FetchCatalogueItem().execute();
} else {
if(application.isNetConnected()) {
new FetchCatalogueItem().execute();
} else {
List<CatalogueItem> catalogueItemList = CatalogueItemManager.getAllCatalogueItems(mCatalogue.getId());
if(catalogueItemList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueItemScreen.this);
} else {
setData(catalogueItemList);
}
} else {
setData(catalogueItemList);
}
}
......
......@@ -67,15 +67,15 @@ public class CatalogueScreen extends AppCompatActivity {
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
List<Catalogue> catalogueList = CatalogueManager.getAllCatalogues();
if(catalogueList.isEmpty()) {
if(application.isNetConnected()) {
new FetchCatalogue().execute();
if(application.isNetConnected()) {
new FetchCatalogue().execute();
} else {
List<Catalogue> catalogueList = CatalogueManager.getAllCatalogues();
if(!catalogueList.isEmpty()) {
setData(catalogueList);
} else {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueScreen.this);
}
} else {
setData(catalogueList);
}
}
......
......@@ -171,17 +171,17 @@ public class CatalogueVariableScreen extends AppCompatActivity {
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
mCatalogueVariableList = CatalogueVariableManager.getAllVariable(mCatalogueItem.getId());
setVariableChoices();
if (mCatalogueVariableList.isEmpty()) {
if (mApplication.isNetConnected()) {
new FetchCatalogueVariable().execute();
} else {
if (mApplication.isNetConnected()) {
new FetchCatalogueVariable().execute();
} else {
mCatalogueVariableList = CatalogueVariableManager.getAllVariable(mCatalogueItem.getId());
if (mCatalogueVariableList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueVariableScreen.this);
} else {
setVariableChoices();
createView();
runUIPolicyActions(null);
}
} else {
createView();
runUIPolicyActions(null);
}
}
......
......@@ -67,15 +67,15 @@ public class MyIncidentScreen extends AppCompatActivity {
// Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString());
mIncidentList = MyIncidentsManager.getAllIncidents();
if(mIncidentList.isEmpty()) {
if (application.isNetConnected()) {
new FetchIncident().execute();
} else {
if (application.isNetConnected()) {
new FetchIncident().execute();
} else {
mIncidentList = MyIncidentsManager.getAllIncidents();
if(mIncidentList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(MyIncidentScreen.this);
} else {
setData(mIncidentList);
}
} else {
setData(mIncidentList);
}
}
......
......@@ -68,15 +68,15 @@ public class MyRequestActivity extends AppCompatActivity {
mAdapter = new MyRequestAdapter(MyRequestActivity.this);
mListView.setAdapter(mAdapter);
List<MyRequest> myRequestList = MyRequestsManager.getAllRequests();
if(myRequestList.isEmpty()) {
if(application.isNetConnected()) {
new FetchMyRequestData().execute();
} else {
if(application.isNetConnected()) {
new FetchMyRequestData().execute();
} else {
List<MyRequest> myRequestList = MyRequestsManager.getAllRequests();
if(myRequestList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(MyRequestActivity.this);
} else {
setData(myRequestList);
}
} else {
setData(myRequestList);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment