Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="o">AN_Intent</param>
        public AN_Intent(AN_Intent o)
        {
            var json = JsonUtility.ToJson(o);

            JsonUtility.FromJsonOverwrite(json, this);
        }
Ejemplo n.º 3
0
 public void AddExtraIntent(AN_Intent intent)
 {
     m_extra_initial_intents.Add(JsonUtility.ToJson(intent));
 }