-
Notifications
You must be signed in to change notification settings - Fork 815
fix: resolved empty data bug in lux meter #1401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| editor.putLong("uniqueCount", uniqueRef + 1); | ||
| editor.commit(); | ||
| }else{ | ||
| CustomSnackBar.showSnackBar(coordinatorLayout, "No Data Fetched", null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this text to strings.xml and fetch from there
| SharedPreferences.Editor editor = realmPreferences.edit(); | ||
| editor.putLong("uniqueCount", uniqueRef + 1); | ||
| editor.commit(); | ||
| if(selectedFragment.saveDataInRealm(uniqueRef, locationPref, gpsLogger)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give this code a reformat
| realm.beginTransaction(); | ||
|
|
||
| SensorLogged sensorLogged = realm.createObject(SensorLogged.class, uniqueRef); | ||
| sensorLogged.setSensor("Lux Meter"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes to strings.xml
|
|
||
| if (includeLocation && gpsLogger != null) { | ||
| Location location = gpsLogger.getBestLocation(); | ||
| if (location != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check location null in the 414 if block and reduce this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that but then I had to do this to prevent some null pointer exceptions.
some minor chages
38ce7ac to
b77d8e5
Compare
some minor chages
Fixes #1400
Changes:
Added if-else in lux meter fragment to check for empty data before storing in the realm database in the form of record.
Screenshot/s for the changes:Not a UI change
Checklist: [Please tick following check boxes with
[x]if the respective task is completed]strings.xml,dimens.xmlandcolors.xmlwithout hard-coding themstrings.xml,dimens.xmlorcolors.xmlAPK for testing:
emptyfix.zip