public void ToggleDownload(Activity activity, string name, android.Net.Uri uri, string extension)
        {
            if (IsDownloaded(uri))
            {
                DownloadAction removeAction =
                    GetDownloadHelper(uri, extension).GetRemoveAction(Utils.GetUtf8Bytes(name));

                StartServiceWithAction(removeAction);
            }
            else
            {
                StartDownloadDialogHelper helper = new StartDownloadDialogHelper(activity, GetDownloadHelper(uri, extension), this, name);
                helper.Prepare();
            }
        }
            public void OnClick(IDialogInterface dialog, int which)
            {
                Java.Util.ArrayList selectedTrackKeys = new Java.Util.ArrayList();
                for (int i = 0; i < representationList.ChildCount; i++)
                {
                    if (representationList.IsItemChecked(i))
                    {
                        selectedTrackKeys.Add(trackKeys[i]);
                    }
                }
                if (!selectedTrackKeys.IsEmpty || trackKeys.Count == 0)
                {
                    // We have selected keys, or we're dealing with single stream content.
                    DownloadAction downloadAction =
                        downloadHelper.GetDownloadAction(Utils.GetUtf8Bytes(name), selectedTrackKeys);

                    downloadTracker.StartDownload(downloadAction);
                }
            }