Android Question How to get Activity being touched?

Discussion in 'Android Questions' started by JohnC, Aug 2, 2016.

  1. JohnC

    JohnC Well-Known Member Licensed 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:

    Code:
    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?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I'm not familiar with this library. However can't you get the view that is inside the clicked cell?
     
    Peter Simpson likes this.
  3. JohnC

    JohnC Well-Known Member Licensed 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.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice