Android organize apps alphabetically


I’m trying understand this ListView working and i am attempting to sort their email list alphabetically through the application title rather than the package title.

// load list application
mListAppInfo = (ListView)findViewById(
// create new adapter
AppInfoAdapter adapter = new AppInfoAdapter(this, Utilities.getInstalledApplication(this), getPackageManager())
// set adapter to list out view

public AppInfoAdapter(Context c, List list, PackageManager pm)

public View getView(int position, View convertView, ViewGroup parent) obtain the selected entry
ApplicationInfo entry = (ApplicationInfo) mListAppInfo.get(position)

// mention of the convertView
View v = convertView

// inflate new layout if null
if(v == null)

// load controls from layout assets
ImageView ivAppIcon = (ImageView)v.findViewById(
TextView tvAppName = (TextView)v.findViewById(
TextView tvPkgName = (TextView)v.findViewById(

// set data to show

// return view
return v

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>