QuickAction3D.addActionItem(ai)

CharlesIPTI

Active Member
Licensed User
Longtime User
OK I was going to post this in the QuickAction section but it is a presentation post not a question post.... I frequently get an Index out of bounds error in attempts to use the 3d version of Quick Action Menu.....

I forced it in the sample but I have other code samples (TOO BIG ) where I have Boolean flags preventing entry into this code section the one I'm having problems with actually has a counter ....
so if the counter is under 2 and the Boolean value to allow entry into this code block is true THEN and ONLY then do the Quick Action menu stuff...


the counter reads true and the Boolean flag is set in only select places but I still get the error


I just grabbed the code section and OMG there's three checks
B4X:
      If bAllowEntry = True Then
                  If bolQaMenuCreated = False Then   
      
                  subSpecificCounter = subSpecificCounter +1 
                  If subSpecificCounter < 2 Then



It only errors on the 3D Version WHATS UP WITH THAT ?!?!?!?
The regular version doesn't complain about an index out of bounds, but its getting the SAME MENU ITEMS !!!
Whats going on here ::

B4X:
               'Initialize a bitmap drawable and the action item
                  bd.Initialize(LoadBitmap(File.DirAssets, Filename))
                  ai.Initialize(i, Text, bd)
                  ai.Selected = True
                  
                  'Make the Prev and Next items sticky so they will not close the popup
                  'If i = 1 OR i = 2 Then ai.Sticky = True
                  
                  'Add the item to both Quickactions popups
                  ac1.addActionItem(ai)
                  ac2.addActionItem(ai)
 
Last edited:

CharlesIPTI

Active Member
Licensed User
Longtime User
Resolved OOPS

you cant have the initialize portion in the loop

ac1.Initialize("XC")
ac2.Initialize("XC", ac2.VERTICAL)
Plain and Simple


Too bad you have to go back into Java to cook up your own Images
and menu text. but it doesn't look too hard from the sample provided in the original project...


http://www.b4x.com/forum/additional...brary-nice-looking-popup-menus.html#post82474
https://github.com/lorensiuswlt/NewQuickAction
https://github.com/lorensiuswlt/NewQuickAction3D
How to Create QuickAction Dialog in Android | All About Web & Mobile Application Development
 
Upvote 0

William Hunter

Active Member
Licensed User
Longtime User
Too bad you have to go back into Java to cook up your own Images
and menu text. but it doesn't look too hard from the sample provided in the original project...

I get the same Index out of bounds error when using AHQuickAction3D menus in a project. There is nothing in code that is set up different to that in the example. The only other difference is that it is now not a standalone example, but rather a miniscule bit of code in a much larger project.

The one thing that I have found is that that this error in no way affects the performance of a finished project. I have just sat for an hour testing a finished project on my tablet. There was not even I hint of a problem. The menu continued to function flawlessly through rotations, wifi connections, incoming data, outgoing requests etc. I punished that application as hard as I could. There was not one malfunction.

All this has me wondering if this is an error that is being thrown by the library for no apparent reason, as there is no perceptible degradation in performance. These are nice looking menus, and I would like to continue to use them.

Does anyone else have thoughts to contribute? :sign0163:

Regards
 
Upvote 0
Top