-
Notifications
You must be signed in to change notification settings - Fork 54
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
Notification #30
base: master
Are you sure you want to change the base?
Notification #30
Conversation
…when notification appears (always/only when tasks are running/never).
.setContentText(content); | ||
|
||
// TODO: Watch this, because sometimes we get a | ||
// StackOverflowError. |
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.
Is this still an issue?
Thank you for the pull request. |
// Finally, go to sleep and call run() again. | ||
try { | ||
Log.d(TAG, "Sleeping for " + SLEEP_TIME); | ||
Thread.sleep(TaskNotificationThread.SLEEP_TIME); |
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.
Is it required that the thread is woken up once every second? Is this usually how notifications work? If it where possible to have the thread instead wait for a notify when there is a change we could probably save some battery.
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.
Hi, Marckus. As per the official android docs (https://developer.android.com/guide/topics/ui/notifiers/notifications.html) this is the way to start a notification. I set the time for 1 second because that's usually the interval for a clock but we can make it longer for more of a "fuzzy" time if you'd like.
I noticed that when I was using the application a lot of times I would clock in to an activity, forget to clock out and then hours later (or even the next day o.0) find I hadn't clocked out. After I added the notification it made it easier to remember that a task was running. |
any progress on this issue, @netmackan? |
Why not merge? |
I see a few questions that have not been answered. Maybe they are not relevant anymore but in that case you can state so and why. |
Hi, Markus,
Great application. Hope you don't mind if I added code to include a notification.