Beispiel #1
0
        //--------------------------------------
        // Public Static Methods
        //--------------------------------------


        /// <summary>
        /// Convenience function for creating a ACTION_CHOOSER Intent.
        ///
        /// Builds a new ACTION_CHOOSER Intent that wraps the given target intent,
        /// also optionally supplying a title.
        /// If the target intent has specified FLAG_GRANT_READ_URI_PERMISSION or FLAG_GRANT_WRITE_URI_PERMISSION,
        /// then these flags will also be set in the returned chooser intent
        /// </summary>
        /// <param name="intent">The Intent that the user will be selecting an activity to perform.</param>
        /// <param name="title">Title that will be displayed in the chooser.</param>
        /// <param name="extraInitialIntents">Optional, additional activities to place a the front of the list of choices, when shown to the user with a ACTION_CHOOSER.</param>
        /// <returns></returns>
        public static AN_Intent CreateChooser(AN_Intent intent, string title, params AN_Intent[] extraInitialIntents)
        {
            var chooser = new AN_IntentChooserInfo(title);

            foreach (var extraIntent in extraInitialIntents)
            {
                chooser.AddExtraIntent(extraIntent);
            }

            intent.SetChooserParams(chooser);
            return(intent);
        }
Beispiel #2
0
 private void SetChooserParams(AN_IntentChooserInfo chooserInfo)
 {
     m_IsChooser   = true;
     m_ChooserInfo = chooserInfo;
 }