Android Question ULV ItemLongClick does not fire

Declan

Well-Known Member
Licensed User
Longtime User
I cannot get the ULV ItemLongClick event fire?
The ULVimages is created in the designer.
My Code:
B4X:
Sub ULVimages_ItemLongClick(ItemID As Long, Position As Int, ClickedPanel As Panel)
    Log("longclick")
    Dim Imagename As String
    dbCursorIMG.Position = Position
    Imagename = dbCursorIMG.GetString("picName")
    ImageToDelete = Imagename
   
    Dim result As Int
    result = Msgbox2("OK to Delete this Picture " & ImageToDelete & "?", "eBuki Help", "OK", "", "NO",LoadBitmap (File.DirAssets, "eBuki-notification-logo.png"))
    If result = DialogResponse.Positive Then
        ToastMessageShow("Deleting Image " & ImageToDelete, False)
        File.Delete(File.DirRootExternal & "/DCIM/Camera/", ImageToDelete)
        LoadPictures
    Else
        pnlGallery.Visible = False
    End If
End Sub
I have tried the solution here:
but still not working.
 

Declan

Well-Known Member
Licensed User
Longtime User
How are you initializing the ulv?
What event name?
As follows:
B4X:
    ULVimages.Initialize(0, 0, "", "ULVimages")
    ULVimages.SelectionMode = ULVimages.SELECTION_SINGLE
In Designer the EventName is "ULVImages"
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Try to remove:

B4X:
ULVimages.SelectionMode = ULVimages.SELECTION_SINGLE

If you perform a long click do you see in the logs: longclick?
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
Normaly views that are created in designer should not be initialized via code.

Try to remove the initializing in code and check the event name you put in designer.

Does the click event fire? (Not longclick)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
actually i am working on a project and i also use ULV in it and here the _itemlongclick works fine.
can you upload a small project where the longclick does not work for you and i will try it out.
 
Upvote 0
Top