/**
         * Adds a menu item.
         *
         * @param label Menu label.
         * @param pendingIntent Pending intent delivered when the menu item is clicked.
         */
        public HostedUIBuilder AddMenuItem(string label, PendingIntent pendingIntent)
        {
            var bundle = new global::Android.OS.Bundle();

            bundle.PutString(KEY_HOSTED_MENU_TITLE, label);
            bundle.PutParcelable(KEY_HOSTED_PENDING_INTENT, pendingIntent);
            menuItems.Add(bundle);
            return(this);
        }
예제 #2
0
        public bool MayLaunchUrl(string url, List <string> otherLikelyUrls)
        {
            var otherLikelyBundles = new List <global::Android.OS.Bundle> ();

            if (otherLikelyUrls != null)
            {
                foreach (var otherUrl in otherLikelyUrls)
                {
                    var bundle = new global::Android.OS.Bundle();
                    bundle.PutString("url", otherUrl);
                    otherLikelyBundles.Add(bundle);
                }
            }
            enqueueAction(() => {
                try {
                    var ja = new global::Android.Runtime.JavaList(otherLikelyBundles);
                    connectionService.MayLaunchUrl(sessionId, url, null, ja);
                } catch (global::Android.OS.RemoteException e) {
                    // Nothing
                }
            });
            return(true);
        }