5

I have implemented an Android app, and just added MonkeyTalk library to test the usability of the system by recording user interaction with the app.

After using this library, everything works, but DatePicker!

I use the following method to show DatePicker dialog:

private void setSpecificDate() {

    int mYear = calendar.get(Calendar.YEAR);
    int mMonth = calendar.get(Calendar.MONTH);
    int mDay = calendar.get(Calendar.DAY_OF_MONTH);
    DatePickerDialog dpd = new DatePickerDialog(getActivity(), 
            new OnDateSetListener() {

                @Override
                public void onDateSet(DatePicker view, int year, int monthOfYear,
                        int dayOfMonth) {

                // part of code uses retrieved data from DataPicker...

                }
            }, mYear, mMonth, mDay);
    dpd.show();
}

Then, as soon as I click to show the DatePicker, it crashes, I get the runtime error, and the program fails!

When I just comment out dpd.show(); It works, but nothing happens.

I have also tested to use TimePicker instead of DatePicker to check app behavior, and it worked!

The runtime error:

E/AndroidRuntime( 2679): FATAL EXCEPTION: main
E/AndroidRuntime( 2679): Process: com.parse.f8, PID: 2679
E/AndroidRuntime( 2679): java.lang.reflect.UndeclaredThrowableException
E/AndroidRuntime( 2679):    at $Proxy6.onItemSelected(Unknown Source)
E/AndroidRuntime( 2679):    at android.widget.AdapterView.fireOnSelected(AdapterView.java:897)
E/AndroidRuntime( 2679):    at android.widget.AdapterView.access$200(AdapterView.java:48)
E/AndroidRuntime( 2679):    at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:865)
E/AndroidRuntime( 2679):    at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 2679):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 2679):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 2679):    at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime( 2679):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 2679):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 2679):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime( 2679):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime( 2679): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 2679):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 2679):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.automators.AutomatorBase$MonkeyInvocationHandler.invoke(AutomatorBase.java:571)
E/AndroidRuntime( 2679):    at java.lang.reflect.Proxy.invoke(Proxy.java:397)
E/AndroidRuntime( 2679):    ... 12 more
E/AndroidRuntime( 2679): Caused by: java.lang.IllegalStateException: Unable to find field mOnDateChangedListener in any superclass of android.view.View$ListenerInfo
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.automators.AutomatorBase.chainListenerFor(AutomatorBase.java:483)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.automators.DatePickerAutomator.installDefaultListeners(DatePickerAutomator.java:43)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.processView(FunctionalityAdder.java:71)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:48)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.FunctionalityAdder.walkTree(FunctionalityAdder.java:58)
E/AndroidRuntime( 2679):    at com.gorillalogic.fonemonkey.aspects.OnCreate.ajc$afterReturning$com_gorillalogic_fonemonkey_aspects_OnCreate$7$35d40fb6(OnCreate.aj:115)
E/AndroidRuntime( 2679):    at com.parse.f8.view.SettingAdvTime.setSpecificDate(SettingAdvTime.java:396)
E/AndroidRuntime( 2679):    at com.parse.f8.view.SettingAdvTime.access$3(SettingAdvTime.java:373)
E/AndroidRuntime( 2679):    at com.parse.f8.view.SettingAdvTime$1.onItemSelected(SettingAdvTime.java:122)
E/AndroidRuntime( 2679):    ... 16 more

I would appreciate anyone's assist to solve this problem.

Masood
  • 685
  • 2
  • 8
  • 16
  • Were you able to resolve your issue ? I came across a similar issue - http://stackoverflow.com/questions/31075930/my-date-picker-is-not-working?noredirect=1#comment50172892_31075930 – San Jun 27 '15 at 09:35
  • I did the same as you've done. Removed MonkeyTalk and created my own custom class to record the interaction logs in a remote server. I used Parse API for this purpose: https://www.parse.com – Masood Jul 08 '15 at 07:23

0 Answers0