FileDocCategorySizeDatePackage
AppPicker.javaAPI DocAndroid 1.5 API4882Wed May 06 22:41:08 BST 2009com.android.development

AppPicker

public class AppPicker extends android.app.ListActivity

Fields Summary
private static final Comparator
sDisplayNameComparator
private AppListAdapter
mAdapter
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);

        mAdapter = new AppListAdapter(this);
        if (mAdapter.getCount() <= 0) {
            finish();
        } else {
            setListAdapter(mAdapter);
        }
    
protected voidonListItemClick(android.widget.ListView l, android.view.View v, int position, long id)

        ApplicationInfo app = mAdapter.appForPosition(position);
        Intent intent = new Intent();
        if (app != null) intent.setAction(app.packageName);
        setResult(RESULT_OK, intent);
        
        /* This is a temporary fix for 824637 while it is blocked by 805226.  When 805226 is resolved, please remove this. */
        try {
            boolean waitForDebugger = Settings.System.getInt(
                    getContentResolver(), Settings.System.WAIT_FOR_DEBUGGER, 0) != 0;
            ActivityManagerNative.getDefault().setDebugApp(
                    app != null ? app.packageName : null, waitForDebugger, true);
        } catch (RemoteException ex) {
        }
        
        finish();
    
protected voidonResume()

        super.onResume();
    
protected voidonStop()

        super.onStop();