Friday, April 22, 2011

[android-developers] Re: NPE in java.util.Calendar

Test "Date SunsetTime = c.getSunset(); " to see if it is returning
NULL, before using it in the next line.

On Apr 22, 10:41 am, Jake Colman <col...@ppllc.com> wrote:
> The code that triggers this crash is as follows:
>
> ZmanimCalendar c = new ZmanimCalendar(l);
> Date SunsetTime = c.getSunset();
> String SunsetTimeString =
>    DateFormat.getTimeInstance(DateFormat.SHORT).format(SunsetTime);
>
> What could possibly trigger an NPE in this code?  Is there something I
> should be checking about SunsetTime before passing it in to be
> formatted?

--
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


Real Estate