Code example for Activity

Methods: getPackageManager

0
        void shortcutPicked(String uri, String friendlyName, boolean isApplication);
    } 
 
    public ShortcutPickHelper(Activity parent, OnPickListener listener) {
        mParent = parent;
        mPackageManager = mParent.getPackageManager();
        mListener = listener;
    } 
 
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (resultCode == Activity.RESULT_OK) {
            switch (requestCode) {
            case REQUEST_PICK_APPLICATION:
                completeSetCustomApp(data);
                break; 
            case REQUEST_CREATE_SHORTCUT:
                completeSetCustomShortcut(data);
                break; 
            case REQUEST_PICK_SHORTCUT:
                processShortcut(data, REQUEST_PICK_APPLICATION, REQUEST_CREATE_SHORTCUT);
                break;