On 4 February 2011 16:07, mot12 <martin.hu...@gmail.com> wrote: > Looks like I screwed up big time. I retrieved the wrong revision when > checking this users code. The null pointer was actually the line > following: > if (Settings.System.getString(getContentResolver(), > Settings.System.ACCELEROMETER_ROTATION)).equals("1")) > which should have been > if > ("1".equals(Settings.System.getString(getContentResolver(), > Settings.System.ACCELEROMETER_ROTATION)))) > for obvious reasons.
Still such writting style is quite error prone. Unless you know it you can't tell from the code that null can happen. And you just "save" two lines while clearness of the source dropped much more. Just my 5 cents :) -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en