Posts

Showing posts from 2014

Display List item with Labels and index in Android

Image
Hello Guys !! Hope you are doing well... In this tutorials, you will learn how to display list with labels and with index. In my previous post, I've explain about how to get Phone contact and display in listview in your android application. Now I'm using the same concept here also. Get contacts from the phone and then display in Listview with labels and indexs. Here are all the  necessary  java and xml files. 1.  LabelListActivity.java package com.pack.listlabel; import java.util.ArrayList; import android.annotation.SuppressLint; import android.app.Activity; import android.app.ProgressDialog; import android.database.Cursor; import android.graphics.Color; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.provider.ContactsContract; import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.view.Window; import android.widg

Get Phone Contacts and display in Listview in Android

Image
Hello Guys !! In this tutorials, you will learn how to get Phone contact and display in listview in your android application. Here is the full example to read the phone contact and display in listview. Here is the java files : 1. GetContactActivity.java package com.pack.getcontact; import java.util.ArrayList; import java.util.HashMap; import android.app.Activity; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; import android.os.Bundle; import android.provider.ContactsContract; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ListView; import android.widget.TextView; public class GetContactActivity extends Activity{ ListView contactLV; ArrayList<HashMap<String , String>> ContactList = new ArrayList<HashMap<String,String>>(); @Override protected void onCreate(Bundle savedIn