Libraries conflict

ukimiku

Active Member
Licensed User
Longtime User
Dear all,

using the AndroidResources library I am localizing a newly dim'ed string t:

B4X:
t = mikursres.Get("load_form")
ToastMessageShow(t, False)

This works fine. t has been localized correctly. Now I want to use t as one entry for a pop-up menu in the AHQuickAction library (v1.0)

B4X:
ai.Initialize(1, t, bd)    ' ai is of type AHActionItem
ac2.addActionItem(ai)     ' ac2 is of type AHQuickAction3D

I now get a java null pointer exception on t (the bd bitmap is not null), although t can be referenced by, say, ToastMessageShow(t, false).

When I set t in code myself,
B4X:
t = "Select a form to load"         ' t is a newly dimensioned string
ai.Initialize(1, t, bd)         ' ai is of type AHActionItem
ac2.addActionItem(ai)    ' ac2 is of type AHQuickAction3D

the pop-up works fine.

So the problem is narrowed down to an incompatibility between the format of the text passed to my app and then on to the AHQuickAction lib. Could this be due to the fact that the AndroidResource system returns UTF-8-encoded strings? If so, how can I make these calls compatible?

Thank you.

Regards,
 

ukimiku

Active Member
Licensed User
Longtime User
Erel,

thanks for replying and pointing me elsewhere. You were right, it was not the string format that causes problems (reassuring).

I have found that after a couple dozen program runs from the IDE, AHQuickAction causes problems I cannot uncover sufficiently. I have decided to not use that library. Anyway, please find attached an error log. I checked that every item needed to call the AddActionItem had been initialized correctly (bitmap, text).

So, case closed. Still learning what I can use and what I can't. Again, thanks for helping.

Regards,




LogCat connected to: CB511X6A21
--------- beginning of /dev/log/system


--------- beginning of /dev/log/main


** Activity (main) Create, isFirst = true **
** Activity (main) Create, isFirst = true **
main_activity_create (B4A line: 75)


formloader.addActionItem(ai)

java.lang.NullPointerException
at de.amberhome.quickaction.QuickAction3D.addActionItem(QuickAction3D.java:173)
at de.noemanetz.mikurs.main._activity_create(main.java:331)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at de.noemanetz.mikurs.main.afterFirstLayout(main.java:84)
at de.noemanetz.mikurs.main.access$100(main.java:16)
at de.noemanetz.mikurs.main$WaitForLayout.run(main.java:72)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:138)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)


at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
** Activity (main) Resume **
 
Upvote 0
Top