Code example for ComponentName

Methods: flattenToShortString

0
 
    // Called on the main thread 
    private void storeShortcut(ComponentName sourceComponent, ContentValues shortcut) {
        if (DBG) Log.d(TAG, "Adding (PID: " + Binder.getCallingPid() + "): " + shortcut);
 
        Source source = getCorpora().getSource(sourceComponent.flattenToShortString());
        if (source == null) {
            Log.w(TAG, "Unknown shortcut source " + sourceComponent);
            return; 
        } 
 
        String userQuery = shortcut.getAsString(SearchManager.USER_QUERY);
        if (userQuery == null) userQuery = "";
 
        ListSuggestionCursor cursor = new ListSuggestionCursor(userQuery);
        cursor.add(makeSuggestion(source, shortcut));
        getShortcutRepository().reportClick(cursor, 0);
    } 
 
    private boolean checkCallingPackage(String packageName) {
Contextual code suggestions in your IDE  Get Codota for Java