tags:

views:

47

answers:

0

If you long press on your homescreen and pick to add an application shortcut, you will be greeted with a listview showing all of your instal applications. I needed this same functionality in my application so I copied the intent from the launcher source:

        Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
        mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);            
        Intent pickIntent = new Intent(Intent.ACTION_PICK_ACTIVITY);
        pickIntent.putExtra(Intent.EXTRA_INTENT, mainIntent);
        this.startActivityForResult(pickIntent, MoreIconsConstants.REQUEST_PICK_APPLICATION)

When this executes on the launcher it is pretty speedy. When I execute this in my activity it takes maybe 15 seconds instead of 3. It seems like the launcher must be caching this data for some amount of time? Is there any way I can cache the data too?

Thanks!