[android-beginners] Re: Implementing a Service - Call down to super?
Maybe, maybe not. It depends on what you want to do. On Jul 15, 2:46 pm, Jake Colman col...@ppllc.com wrote: When extending Service with your own Service, should you be calling down to the super implementation of the methods that are being overridden? If so, do you do it before or after you've invoked your own code? -- Jake Colman -- Android Tinkerer -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
Re: [android-beginners] Re: Implementing a Service - Call down to super?
But DanH is right, it totally depends on what you want to do. It also depends on what super does... If your subclass is setting information that is also set by super then chances are you would want to call super first. If what super does varies based on settings in your implementation, then you would want to call super last. If there is no such relationship then it doesn't matter when you call. Also, IMHO, you would only want to skip calling super in extremely rare circumstances. And, technically speaking, you would be calling up to the super implementation, but that's just semantics... :-) -- There are only 10 types of people in the world... Those who know binary and those who don't. -- On Thu, Jul 15, 2010 at 1:54 PM, DanH danhi...@ieee.org wrote: Maybe, maybe not. It depends on what you want to do. On Jul 15, 2:46 pm, Jake Colman col...@ppllc.com wrote: When extending Service with your own Service, should you be calling down to the super implementation of the methods that are being overridden? If so, do you do it before or after you've invoked your own code? -- Jake Colman -- Android Tinkerer -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Implementing a Service - Call down to super?
Dan, Thanks but that's not quite helpful! :-) I have my own onCreate and onStart and onDestroy methods that do my service-specific actions. Do I need to also invoke the super-class methods to keep Android happy? And, if so, do I do it before or after I do my own work? ...Jake D == DanH danhi...@ieee.org writes: D Maybe, maybe not. It depends on what you want to do. D On Jul 15, 2:46 pm, Jake Colman col...@ppllc.com wrote: When extending Service with your own Service, should you be calling down to the super implementation of the methods that are being overridden? If so, do you do it before or after you've invoked your own code? -- Jake Colman -- Android Tinkerer D -- D You received this message because you are subscribed to the Google D Groups Android Beginners group. D NEW! Try asking and tagging your question on Stack Overflow at D http://stackoverflow.com/questions/tagged/android D To unsubscribe from this group, send email to D android-beginners+unsubscr...@googlegroups.com D For more options, visit this group at D http://groups.google.com/group/android-beginners?hl=en -- Jake Colman -- Android Tinkerer -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Implementing a Service - Call down to super?
Justin, What you saying is certainly true generically. But I am specifically talking about a class as follows: public class JakeService extends Service { } In example code I don't think I usually see calls up to the super implementations. That seems wrong. So when extending the Service class do you call super before or after you do your own work? Wouldn't the answer to this question be the same regardless of what my Service implementation does? ...Jake JA == Justin Anderson janderson@gmail.com writes: JA But DanH is right, it totally depends on what you want to do. It JA also depends on what super does... If your subclass is setting JA information that is also set by super then chances are you would JA want to call super first. If what super does varies based on JA settings in your implementation, then you would want to call JA super last. If there is no such relationship then it doesn't JA matter when you call. JA Also, IMHO, you would only want to skip calling super in JA extremely rare circumstances. JA And, technically speaking, you would be calling up to the super JA implementation, but that's just semantics... :-) JA -- JA There are only 10 types of people in the world... JA Those who know binary and those who don't. JA -- JA On Thu, Jul 15, 2010 at 1:54 PM, DanH danhi...@ieee.org wrote: Maybe, maybe not. It depends on what you want to do. On Jul 15, 2:46 pm, Jake Colman col...@ppllc.com wrote: When extending Service with your own Service, should you be calling down to the super implementation of the methods that are being overridden? If so, do you do it before or after you've invoked your own code? -- Jake Colman -- Android Tinkerer -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.comandroid-beginners%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en JA -- JA You received this message because you are subscribed to the Google JA Groups Android Beginners group. JA NEW! Try asking and tagging your question on Stack Overflow at JA http://stackoverflow.com/questions/tagged/android JA To unsubscribe from this group, send email to JA android-beginners+unsubscr...@googlegroups.com JA For more options, visit this group at JA http://groups.google.com/group/android-beginners?hl=en -- Jake Colman -- Android Tinkerer -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en