Merge branch 'dev' into cobthread
This commit is contained in:
commit
8a45422135
2 changed files with 6 additions and 7 deletions
|
@ -70,7 +70,7 @@ public class FoodHelper {
|
||||||
public boolean createOrUpdate(Food food) {
|
public boolean createOrUpdate(Food food) {
|
||||||
try {
|
try {
|
||||||
// find by NS _id
|
// find by NS _id
|
||||||
if (food._id != null) {
|
if (food._id != null && !food._id.equals("")) {
|
||||||
Food old;
|
Food old;
|
||||||
|
|
||||||
QueryBuilder<Food, Long> queryBuilder = getDaoFood().queryBuilder();
|
QueryBuilder<Food, Long> queryBuilder = getDaoFood().queryBuilder();
|
||||||
|
@ -90,12 +90,13 @@ public class FoodHelper {
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
getDaoFood().createOrUpdate(food);
|
||||||
|
log.debug("FOOD: New record: " + food.toString());
|
||||||
|
scheduleFoodChange();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getDaoFood().createOrUpdate(food);
|
|
||||||
log.debug("FOOD: New record: " + food.toString());
|
|
||||||
scheduleFoodChange();
|
|
||||||
return true;
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Unhandled exception", e);
|
log.error("Unhandled exception", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,6 @@ public class FoodFragment extends SubscriberFragment {
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
try {
|
try {
|
||||||
View view = inflater.inflate(R.layout.food_fragment, container, false);
|
View view = inflater.inflate(R.layout.food_fragment, container, false);
|
||||||
log.debug(">>>>>>> start onCreateView");
|
|
||||||
filter = (EditText) view.findViewById(R.id.food_filter);
|
filter = (EditText) view.findViewById(R.id.food_filter);
|
||||||
clearFilter = (ImageView) view.findViewById(R.id.food_clearfilter);
|
clearFilter = (ImageView) view.findViewById(R.id.food_clearfilter);
|
||||||
category = new SpinnerHelper(view.findViewById(R.id.food_category));
|
category = new SpinnerHelper(view.findViewById(R.id.food_category));
|
||||||
|
@ -129,7 +128,6 @@ log.debug(">>>>>>> start onCreateView");
|
||||||
fillCategories();
|
fillCategories();
|
||||||
fillSubcategories();
|
fillSubcategories();
|
||||||
filterData();
|
filterData();
|
||||||
log.debug(">>>>>>> end onCreateView");
|
|
||||||
return view;
|
return view;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Crashlytics.logException(e);
|
Crashlytics.logException(e);
|
||||||
|
|
Loading…
Reference in a new issue