create a layout, including this extended view, which you want to display in the ListItem. Click
add the following code to your LISTViewclick listener where you really want to make it visible
Count is a variable that checks how many times it is pressed, even or odd, to make it visible and invisible, respectively.
IF((count%2)==0) { linearLayout.setvisibilty(View.GONE); } else { linearLayout.setvisibilty(View.VISIBLE); }
LinearLayout here is your required layout in the screenshot ... (create this layout and set its parent visibilty layout to GONE )
set it to invisible at startup. and make it visible on itemclick accordingly
gives you a rough idea, you can customize the code accordingly
Hope this helps. I used the same tricks many times to make things happen
source share