Code example for ComponentName

Methods: flattenToString

0
        static final String KEY_COMPONENT = "c";
        static final String KEY_LABEL = "l";
 
        public ListenerWarningDialogFragment setListenerInfo(ComponentName cn, String label) {
            Bundle args = new Bundle();
            args.putString(KEY_COMPONENT, cn.flattenToString());
            args.putString(KEY_LABEL, label);
            setArguments(args);
 
            return this;
        } 
        @Override 
        public Dialog onCreateDialog(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            final Bundle args = getArguments();
            final String label = args.getString(KEY_LABEL);
            final ComponentName cn = ComponentName.unflattenFromString(args.getString(KEY_COMPONENT));
 
            final String title = getResources().getString(
                    R.string.notification_listener_security_warning_title, label);
            final String summary = getResources().getString(