Re: [android-developers] Re: PLEASE HELP . java.lang.NullPointerException when Service uses ArrayList
>> >> I'm just here to confirm what the other two coders told you ~ I found
>> >> it on first read place a catch( Throwable ) around the call
>> >> to .print_result(MyService.
>> >
>> > That's actually pretty bad advice. Don't place a 'catch (Throwable
>> > ...)'
>> > around anything.
>> >
>>
>> Ever?
>
> That is a good question.
> I suggest asking it each time the situation comes up.
There are 'correct' uses of try / catch blocks, and exceptions in the Java language. You might be able to get away with avoiding using them in your own code, but the standard library throws things, so you can't completely avoid ignoring them.
If you want to enforce a coding standard which eschews them, that's fine, but I don't think it makes sense (otherwise) to make a blanket statement against their use.
kris
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home