uncaught handler: tread main exiting due to uncaught exception ( basically a NULL pointer exception)
<p>I am basically trying to use the alarmclock code and make some changes to it.
I got the 2.0 code from net and my emulator is 2.1, </p>

<p>Now, the compilation errors are all solved, But when I run the app in the emulator, then it throws the error " the app has stopped unexpectedly. plz try again" in the emulator</p>

<p>and in the Logcat i get the following error: </p>

<pre><code>Uncaught handler: thread main exiting due to uncaught exception              
java.lang.NullPointerException                                               
at android.text.format.DateFormat.is24HourFormat(DateFormat.java:204)      
at com.alarmclock.rafia.Alarms.get24HourMode(Alarms.java:518)              
at com.alarmclock.rafia.DigitalClock.setDateFormat(DigitalClock.java:208)  
at com.alarmclock.rafia.DigitalClock.onFinishInflate(DigitalClock.java:121)
</code></pre>

<p>The exact files of my code is here: in this line return android.text.format.DateFormat.is24HourFormat(context);
<a href="http://www.netmite.com/android/mydroid/2.0/packages/apps/AlarmClock/src/com/android/alarmclock/Alarms.java" rel="nofollow">http://www.netmite.com/android/mydroid/2.0/packages/apps/AlarmClock/src/com/android/alarmclock/Alarms.java</a></p>

<p>and in this function:     setDateFormat();
in this file: <a href="http://www.netmite.com/android/mydroid/2.0/packages/apps/AlarmClock/src/com/android/alarmclock/DigitalClock.java" rel="nofollow">http://www.netmite.com/android/mydroid/2.0/packages/apps/AlarmClock/src/com/android/alarmclock/DigitalClock.java</a></p>

<p>Please help I am stuck :(</p>
