Methods Summary |
---|
protected android.content.Intent | getTargetIntent()Get the base intent to use when running
{@link PackageManager#queryIntentActivities(Intent, int)}.
return new Intent();
|
protected android.content.Intent | intentForPosition(int position)Return the actual Intent for a specific position in our
{@link android.widget.ListView}.
ActivityAdapter adapter = (ActivityAdapter) mAdapter;
return adapter.intentForPosition(position);
|
public java.util.List | makeListItems()Perform the query to determine which results to show and return a list of them.
// Load all matching activities and sort correctly
List<ResolveInfo> list = mPackageManager.queryIntentActivities(mIntent,
/* no flags */ 0);
Collections.sort(list, new ResolveInfo.DisplayNameComparator(mPackageManager));
IconResizer resizer = new IconResizer();
ArrayList<ListItem> result = new ArrayList<ListItem>(list.size());
int listSize = list.size();
for (int i = 0; i < listSize; i++) {
ResolveInfo resolveInfo = list.get(i);
result.add(new ListItem(mPackageManager, resolveInfo, resizer));
}
return result;
|
protected void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
mPackageManager = getPackageManager();
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
setContentView(com.android.internal.R.layout.activity_list);
mIntent = new Intent(getTargetIntent());
mIntent.setComponent(null);
mAdapter = new ActivityAdapter();
setListAdapter(mAdapter);
getListView().setTextFilterEnabled(true);
setProgressBarIndeterminateVisibility(false);
|
protected void | onListItemClick(android.widget.ListView l, android.view.View v, int position, long id)
Intent intent = ((ActivityAdapter)mAdapter).intentForPosition(position);
startActivity(intent);
|