Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialfranklyncolebrooke
2,087 PointsHow to disable notifications?
If I'm already in the inbox when I receive a message, I would think that I don't need a system notification appearing. I would just want the message to appear in my inbox with a forced refresh.
I'm sitting here trying to figure out how to implement this extra check... would I create a custom receiver using LocalBroadcastManager? If I were to do that, then how would I check to see if they are in the inbox and send them a different intent vs when they are not in the inbox and would get the regular notification?
Any ideas?
2 Answers
Ben Jakuben
Treehouse TeacherI haven't tried it myself, but you may be able to try Responding with an Intent and trigger the inbox refresh there somehow.
franklyncolebrooke
2,087 PointsOkay, did some more research into using an intent. I think what needs to happen here is the use of a callback function that makes use of a refresh.
I'll mark this as "best answer". I think at this point, I'll have to create another question and start posting code for more specifics. Thanks Ben.
Curiously, do you know of a resource that can explain using callbacks?
Ben Jakuben
Treehouse TeacherI talk briefly about callbacks at the 2:30 mark in this video: http://teamtreehouse.com/library/build-a-selfdestructing-message-android-app/adding-users-using-parsecom/creating-a-new-user-on-parse
For further reading on Callbacks, here's a decent article with some code examples: http://cleancodedevelopment-qualityseal.blogspot.com/2012/10/understanding-callbacks-with-java.html