Android Question prevent click event except for foreground view

le_toubib

Active Member
Licensed User
Longtime User
hi all
i have a listviews on top of a panel containing edittexts. selecting an item from the list should hide it to show the panel back.
my problem is :
clicking on a listview entry will also click on the background edittext view , giving it focus , before the list is hidden, so the panel is shown with the wrong focus ... how to prevent the list_select to reach the overlaped edittext ?
thx
 

LucaMs

Expert
Licensed User
Longtime User
If I understand correctly, you have some EditTexts in the background and a ListView in the foreground.
You can put the ListView in a transparent panel in full screen, containing the ListView and add the event Touch of the panel:
B4X:
Sub pnlForListview_Touch (Action As Int, X As Float, Y As Float)
    Return True
End Sub
 
Upvote 0

le_toubib

Active Member
Licensed User
Longtime User
i did it ,
now the layers are as follows :
1- topmost : listview
2- transparent panel
3- edittext
4- scrollview
5- tabhost (bottom-most)
but still the click event reaches back to the edittext , and the toutch event is not reached when i click on the listview :( , although it s reached if i click on the rim around the the listview
 
Upvote 0
Top