Commit e1d947da by Kunj Gupta

Fixed the crash issues.

parent e3e9f979
......@@ -135,28 +135,27 @@ public class HRCaseItemInputManager implements DBConstants {
}
public static List<HRCaseItemInput> getDirtyItemInput() {
// SQLiteDatabase db = CatalogueApplication.getDatabase();
//
// if(db!=null) {
// Cursor c = db.rawQuery("select * from " + TABLE_HR_CASE_ITEM_INPUT
// + " where " + HR_CASE_ITEM_INPUT_SYNC_DIRTY + ">" + SYNC_FLAG_NONE , null);
// ArrayList<HRCaseItemInput> itemInputList;
// if (c.getCount() > 0) {
// itemInputList = new ArrayList<>(c.getCount());
// while (c.moveToNext()) {
// HRCaseItemInput.HRCaseItemInputBuilder builder = HRCaseItemInput.HRCaseItemInputBuilder.aHRCaseItemInput();
// fillAllItemInputDetails(c, builder);
// itemInputList.add(builder.build());
// }
// } else {
// itemInputList = new ArrayList<>(0);
// }
// c.close();
// return itemInputList;
// } else {
// return new ArrayList<>(0);
// }
return null;
SQLiteDatabase db = CatalogueApplication.getDatabase();
if(db!=null) {
Cursor c = db.rawQuery("select * from " + TABLE_HR_CASE_ITEM_INPUT
+ " where " + HR_CASE_ITEM_INPUT_SYNC_DIRTY + ">" + SYNC_FLAG_NONE , null);
ArrayList<HRCaseItemInput> itemInputList;
if (c.getCount() > 0) {
itemInputList = new ArrayList<>(c.getCount());
while (c.moveToNext()) {
HRCaseItemInput.HRCaseItemInputBuilder builder = HRCaseItemInput.HRCaseItemInputBuilder.aHRCaseItemInput();
fillAllItemInputDetails(c, builder);
itemInputList.add(builder.build());
}
} else {
itemInputList = new ArrayList<>(0);
}
c.close();
return itemInputList;
} else {
return new ArrayList<>(0);
}
}
private static void fillAllItemInputDetails(Cursor c, HRCaseItemInput.HRCaseItemInputBuilder builder) {
......
......@@ -53,13 +53,13 @@ public class MenuProvider {
.setTitle(R.string.home_screen_reports_title)
.setMenuIconResId(R.string.home_screen_reports_icon)
.build(),
// new ApprovalsMenuItemData.Builder()
// .setTitle(R.string.home_screen_approvals_title)
// .setMenuIconResId(R.string.home_screen_approvals_icon)
// .build(),
new NotificationMenuItemData.Builder()
.setTitle(R.string.home_screen_notification_title)
.setMenuIconResId(R.string.home_screen_notification_icon)
.build()
// new ApprovalsMenuItemData.Builder()
// .setTitle(R.string.home_screen_approvals_title)
// .setMenuIconResId(R.string.home_screen_approvals_icon)
// .build()
);
}
\ No newline at end of file
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