Skip to main content

Posts

Showing posts with the label Listview example

Custom ListView in Android

Custom ListView in Android/Listview with image and text/ custom list tutorial/Listview using custom adapter For real-world commercial mobile applications, the default look and feel of the Android ListView is not very attractive. It only renders a simple String in every ListView row using the internal TextView control. For most applications, you want to create an interface that is more graphically rich and visually pleasing to the user. Luckily, ListView is very powerful control and with the help of custom item layouts, it can be customized to suit your needs easily. In this tutorial, I will show you how you can create custom ListView items with icons, custom header layout and how you can use custom ArrayAdapter to glue everything together. I will also show you some performance improvement tips you can use to optimize the memory usage of your ListView control main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://sche

ListView using ListActivity

List View example in android/ program to create listview,simple listview/Listview using list activity/listview  tutorials The display of elements in a list is a very common pattern in mobile applications. The user gets a list of items and can scroll through them. If he selects one item this usually triggers something else. ListView   is one of Android's most widely used widgets. It is capable of displaying a scrollable list of items. These items can be of any type. The data to the ListView will be provided by ListAdapter To add ListView to any activity, we have to include < ListView > tag to the activity’s layout xml. The Activity class that uses ListView should implement the ListActivity instead of plain  Activity class. ListView using ListActivity 1.       Create your activity class by extending ListActivity instead of extending Activity public class HelloListactivityActivity extends ListActivity { 2.       Create a String array that will be placed in the ListView    S