Informatix (or Agraham?),
I used Informatix's "Yes_it_works2" example from another thread (and Agraham's Reflection library) and it worked exactly as expected.
I tried to extend it to include LongClicks and got unexpected results . I cloned the SetOnClickListener line in the class Initialize Sub and changed it to SetOnLongClickListener. I cloned the Click subs in the class and in Main and changed all the Click references in the clones to LongClick. Now I expected the same behavior on a long click as a click. Click works as previously but long click produces a messagebox "Unfortunately, Layout change example has stopped".
Under Debug (legacy) this appears in the log:
Installing file.
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NullPointerException
at android.view.View.showContextMenu(View.java:4545)
at android.view.View.performLongClick(View.java:4514)
at android.widget.TextView.performLongClick(TextView.java:9575)
at android.view.View$CheckForLongPress.run(View.java:18768)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
at dalvik.system.NativeStart.main(Native Method)
What have I missed?
Compiled both in Release and Debug (legacy) using B4A v3.20 and Reflection 2.40 on a Galaxy S3.
Thanks,
Jim
I used Informatix's "Yes_it_works2" example from another thread (and Agraham's Reflection library) and it worked exactly as expected.
I tried to extend it to include LongClicks and got unexpected results . I cloned the SetOnClickListener line in the class Initialize Sub and changed it to SetOnLongClickListener. I cloned the Click subs in the class and in Main and changed all the Click references in the clones to LongClick. Now I expected the same behavior on a long click as a click. Click works as previously but long click produces a messagebox "Unfortunately, Layout change example has stopped".
Under Debug (legacy) this appears in the log:
Installing file.
PackageAdded: package:b4a.example
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
java.lang.NullPointerException
at android.view.View.showContextMenu(View.java:4545)
at android.view.View.performLongClick(View.java:4514)
at android.widget.TextView.performLongClick(TextView.java:9575)
at android.view.View$CheckForLongPress.run(View.java:18768)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5455)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
at dalvik.system.NativeStart.main(Native Method)
What have I missed?
Compiled both in Release and Debug (legacy) using B4A v3.20 and Reflection 2.40 on a Galaxy S3.
Thanks,
Jim