Android Question ListView and OnClick Items to show image

Da He

Member
Licensed User
ListView and OnClick Items to show image

on listview click list item want to show imgae Please Help.



B4X:
#Region  Activity Attributes

    #FullScreen: True
    #IncludeTitle: False
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.

End Sub

Sub Globals
    Dim lv As ListView
    Dim img As ImageView

End Sub

Sub Activity_Create(FirstTime As Boolean)
    lv.Initialize("lv")
    Activity.AddView(lv,0,0,100%x,100%y)
    Activity.Color=0xFFFF0000
        lv.AddSingleLine("koko")
        
    img.Initialize("img")
    img.Bitmap=LoadBitmap(File.DirAssets,"fb.png")
        img.Gravity=Gravity.CENTER
    

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub lv_Itemclick (Position As Int, Value As Object)
    img.Visible=True
End Sub
 
Last edited:
Top