0

I changed the locale of Android Emulator to Arabic to test the Arabic version of my application. The date picker appears as shown below,

Arabic DatePicker

Although the DatePicker was working perfectly in the English version of my application, now t is giving me the following error.

07-08 11:13:44.544: E/AndroidRuntime(696): FATAL EXCEPTION: main
07-08 11:13:44.544: E/AndroidRuntime(696): java.lang.NullPointerException
07-08 11:13:44.544: E/AndroidRuntime(696):  at org.digitalhealthagency.elaj.gui.AppointmentReservationActivity$DoctorWorkingDaysTask.access$2(AppointmentReservationActivity.java:927)
07-08 11:13:44.544: E/AndroidRuntime(696):  at org.digitalhealthagency.elaj.gui.AppointmentReservationActivity$5.onDateSet(AppointmentReservationActivity.java:454)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.app.DatePickerDialog.tryNotifyDateSet(DatePickerDialog.java:148)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.app.DatePickerDialog.onStop(DatePickerDialog.java:155)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.app.Dialog.dismissDialog(Dialog.java:326)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.app.Dialog.dismiss(Dialog.java:302)
07-08 11:13:44.544: E/AndroidRuntime(696):  at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:170)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.os.Looper.loop(Looper.java:137)
07-08 11:13:44.544: E/AndroidRuntime(696):  at android.app.ActivityThread.main(ActivityThread.java:4745)
07-08 11:13:44.544: E/AndroidRuntime(696):  at java.lang.reflect.Method.invokeNative(Native Method)
07-08 11:13:44.544: E/AndroidRuntime(696):  at java.lang.reflect.Method.invoke(Method.java:511)
07-08 11:13:44.544: E/AndroidRuntime(696):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
07-08 11:13:44.544: E/AndroidRuntime(696):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-08 11:13:44.544: E/AndroidRuntime(696):  at dalvik.system.NativeStart.main(Native Met
hod)

Am I missing something I should be doing for the Arabic version?

Mat
  • 202,337
  • 40
  • 393
  • 406
Nouran H
  • 1,992
  • 5
  • 18
  • 24

2 Answers2

1

I found out that this problem appeared when I tested on an Android 4.1 emulator. The DatePickerDialog looks quite different and has one button instead of two, but my code is working normally on Android 4.0.3 emulators and below.

Posted another question here Android: Android 4.1 Emulator Invoking onDateSet Twice from DatePicker Dialog

Community
  • 1
  • 1
Nouran H
  • 1,992
  • 5
  • 18
  • 24
0

I can't think of anything specific to Arabic. In the absence of any code, the best I can do is suggest some debugging techniques.

If you look at the code on line 927 of AppointmentReservationActivity.java, I suspect whatever you're accessing a method/field of will give it away.

If you don't see it right away, try setting a breakpoint on that line and check your variables.

Martin
  • 3,703
  • 2
  • 21
  • 43
  • Thank you for your answer, I found out that the problem is that my onDateSet listener is called twice, could you please check this new post http://stackoverflow.com/questions/11383592/android-android-4-1-emulator-invoking-ondateset-twice-from-datepicker-dialog – Nouran H Jul 08 '12 at 13:42