Android App Development for Beginners - 48 - Custom ListView Adapter

thenewboston · 178K views · 2015 · 10:43

Open on YouTube

Software (other)Software practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they ask how to extend a custom ListView adapter, such as assigning different images to each row or understanding how the adapter finds its row layout.

Recommended by 2 people across 2 different months, 2015 to 2018.

What it is

Part 48 of thenewboston's Android App Development for Beginners series, a screencast tutorial showing how to build a custom ListView adapter in Android Studio. It walks through a CustomAdapter class and a custom row layout, then wires them into a ListView in MainActivity.

What people said

Recommends user5209063 · 2015-08 · Stack Overflow · on “Custom View Adapter”

I watched thenewboston tutorials and there is something I didnt understood. I didnt understand how the MainActicty knows what CustomListView to use-we arent pass any info about it. The only info is the context and the string array that we set-up at the MainActivty. ( [this video] 9:01) it's looks like he took the name of the array from the custom_row but I checked it and this is the MainActivty. public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String [] names = {"a"," b","c", "d", "e"}; ListAdapter elichaiAdapter = new CustomAdapter(this , names); ListView elichai

Recommends The Sweeping Developer · 2018-12 · Stack Overflow · on “How do I alter ListView data within a Custom List Adapter?”

I'm trying to make a ListView of a grocery list in which clicking on any of the buttons alters the quantity of the particular item. This is the XML: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <TextView android:id="@+id/descriptionText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="3" android:text="Description" /> <TextView android:id="@+id/priceText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="3" android:text="$14.99" /> <Button android:id="@+id/lessButton" android:layout_width="wrap_content" android:layout_height=

Cites traktor · 2015-02 · Stack Overflow · on “How should I define icons for a large ListView list (+100 items)”

I have been trying to create a ListView and I have succeded in creating one. However my ListView now uses the same icon for every item in the list. When I have been searching for answers people have just showed examples of lists with less than 10 items. But my list contains well over a 100 items. For the text I just created a string-array in my string.xml, and retrieved them using Resources res = getResources(); String[] list_of_names = res.getStringArray(R.array.names); But how do I do the same with icons? Can/Should I define them in a separate file, just like i did with my string-array? My icons are in my drawables folder. Also, should I even use an array of images for my list icons? Is th

Cites BrandonMayU · 2016-04 · Stack Overflow · on “Load Multiple Images in ListView”

I was following a NewBoston Tutorial ( [this video] ) He showed how to put an image into a list but he never showed how to assign a different image to every piece of text. Here is my MainActivity . public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String[] Jobsites = {"River Park Place", "Mayfair", "Jameson House"}; ListAdapter jobsiteAdapter = new CustomAdapter(this, Jobsites); ListView jobsiteListView = (ListView) findViewById(R.id.jobsiteListView); jobsiteListView.setAdapter(jobsiteAdapter); jobsiteListView.setOnItemClickListener( new AdapterView.OnItemClickList