[android-developers] Re: super.onResume() at beginning or end of method? Does it matter?

2010-04-01 Thread HippoMan
Thanks to all. I also have generally been sticking with the pattern that's described here. I guess that will be mostly safe, taking Bob Kerns' exception into account. And thanks to Bob Kerns for submitting that issue. I hadn't realized that there was no known contract for this. I hadn't found

[android-developers] Re: super.onResume() at beginning or end of method? Does it matter?

2010-04-01 Thread patbenatar
Very interesting. Thanks for pointing out this strange behavior, Bob! On Mar 31, 8:49 pm, Bob Kerns r...@acm.org wrote: It's a good pattern, but I've found some exceptions. For example, the theme I wanted to apply to my PreferenceActivity wouldn't take effect unless I put it before the

[android-developers] Re: super.onResume() at beginning or end of method? Does it matter?

2010-03-31 Thread patbenatar
I'm not positive about this, but I have never run into any issues doing it the following way: In any method that runs when something starts [ie: onCreate, onResume], I call through to super FIRST, allowing the system to start up whatever it needs to before I do anything. On methods that run when

Re: [android-developers] Re: super.onResume() at beginning or end of method? Does it matter?

2010-03-31 Thread Dianne Hackborn
Yeah this is a good pattern. In most cases it probably doesn't matter, but it's a general rule: during any kind of initialization, let the super class do their work first; during any kind of finalization, you do your work first. On Wed, Mar 31, 2010 at 12:14 PM, patbenatar patbena...@gmail.com

[android-developers] Re: super.onResume() at beginning or end of method? Does it matter?

2010-03-31 Thread Bob Kerns
It's a good pattern, but I've found some exceptions. For example, the theme I wanted to apply to my PreferenceActivity wouldn't take effect unless I put it before the superclass's onCreate(). To avoid future compatibility issues, the contract really needs to be documented. I've submitted an