Instead of doing
convertView = infalInflater.inflate(R.layout.list_item, null);
do
convertView = infalInflater.inflate(R.layout.list_item, parent, false);
It will inflate it with the given parent, but won’t attach it to the parent.
More Related Contents:
- How to inflate one view with a layout
- What does the LayoutInflater attachToRoot parameter mean?
- How to create custom button like the image
- What is the difference between gravity and layout_gravity in Android?
- How to animate RecyclerView items when they appear
- Set the absolute position of a view
- Pop up window over Android native incoming call screen like true caller Android app
- Unresolved reference – activity does not recognize synthetic imports in android studio v4
- LinearLayout not expanding inside a ScrollView
- How to set space between listView Items in Android
- The following classes could not be found: android.support.v7.internal.app.WindowDecorActionBar
- How to add (vertical) divider to a horizontal LinearLayout?
- Passing Bitmap between two activities [duplicate]
- fitsSystemWindows effect gone for fragments added via FragmentTransaction
- Layout for tablets in Android
- Android Runtime Layout Tutorial
- How to Measure TextView Height Based on Device Width and Font Size?
- Align top of image to top of TextView
- application content goes behind the navigation bar in android L
- Android decoder->decode returned false for Bitmap download
- Android listview with header and footer buttons
- How to add a switch to android action bar?
- How to Apply Corner Radius to LinearLayout
- Items inside GridView getting repeated when screen scrolls
- custom dialog with close button
- Creating an android smart app banner
- Cardview shadow not appearing in lollipop devices?
- How to use setOutlineProvider instead of setOutline in Lollipop
- Newer versions of Android Studio add only two drawable directories – drawable and drawable-v21
- EditText request focus