Android Question How to get Activity being touched?

JohnC

Expert
Licensed User
Longtime User
I am using this cool grid from thedesolatesoul:

https://www.b4x.com/android/forum/threads/msdynamicgridview-library.49331/

Am I am trying to make a popup menu to pop up over the cell that the user long-clicks on. But if I use the ACMenu popup menu:

B4X:
Sub DG_ItemLongClick(Position As Int)
   
    Dim Pop As ACPopupMenu
   
    Pop.Initialize("Popup", DG )
    Pop.AddMenuItem(1, "Delete", Null)
    Pop.AddMenuItem(2, "Rearrange", Null)
    Pop.Show
   
End Sub

The menu will popup near the grid's top left corner and not above the cell being long-clicked.

This must be because I passed "DG" (the datagrid) as the view for the popup menu.

So, it there a way to detect the view under the user's finger that I can pass to the popup routine so it will make the menu appear over the cell the user is touching?
 

JohnC

Expert
Licensed User
Longtime User
I've been trying and I can't figure out how to get any view from the selected grid. "Sender" returns a "non android.view.view" case error, so that won't work either.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…