当前位置: 首页>>代码示例>>C#>>正文


C# Activity.StartActivityForResult方法代码示例

本文整理汇总了C#中Android.App.Activity.StartActivityForResult方法的典型用法代码示例。如果您正苦于以下问题:C# Activity.StartActivityForResult方法的具体用法?C# Activity.StartActivityForResult怎么用?C# Activity.StartActivityForResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.App.Activity的用法示例。


在下文中一共展示了Activity.StartActivityForResult方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CriarChamada

        public void CriarChamada(Activity activity)
        {
            isRecording = !isRecording;
            if (isRecording)
            {
                // Cria o INTENT
                var voiceIntent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                voiceIntent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);

                // Abre um modal com uma mensagem de voz
                voiceIntent.PutExtra(RecognizerIntent.ExtraPrompt, "Diga o nome da pessoa");

                // Se passar de 5.5s considera que não há mensagem falada
                voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputCompleteSilenceLengthMillis, 5500);
                voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputPossiblyCompleteSilenceLengthMillis, 1500);
                voiceIntent.PutExtra(RecognizerIntent.ExtraSpeechInputMinimumLengthMillis, 15000);
                voiceIntent.PutExtra(RecognizerIntent.ExtraMaxResults, 1);

                // Para chamadas em outras líguas
                // voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.German);
                // if you wish it to recognise the default Locale language and German
                // if you do use another locale, regional dialects may not be recognised very well

                voiceIntent.PutExtra(RecognizerIntent.ExtraLanguage, Java.Util.Locale.Default);
                activity.StartActivityForResult(voiceIntent, Constants.VOICE);
            }
        }
开发者ID:Studyxnet,项目名称:BuscaPorVoz,代码行数:27,代码来源:SpeechPage.cs

示例2: Launch

        public static void Launch(Activity act, PwEntry pw, AppTask appTask)
        {
            Intent i = new Intent(act, typeof(EntryEditActivity));

            i.PutExtra(KeyEntry, pw.Uuid.ToHexString());

            appTask.ToIntent(i);

            act.StartActivityForResult(i, 0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:10,代码来源:EntryEditActivity.cs

示例3: ShowInternalLocalFileChooser

        private static void ShowInternalLocalFileChooser(Activity act, int requestCodeBrowse, bool forSaving, string defaultPath)
        {
            #if !EXCLUDE_FILECHOOSER
            string fileProviderAuthority = act.PackageName+".android-filechooser.localfile";

            Intent i = Keepass2android.Kp2afilechooser.Kp2aFileChooserBridge.GetLaunchFileChooserIntent(act,
                                                                                                        fileProviderAuthority,
                                                                                                        defaultPath);
            if (forSaving)
                i.PutExtra("group.pals.android.lib.ui.filechooser.FileChooserActivity.save_dialog", true);

            act.StartActivityForResult(i, requestCodeBrowse);
            #else
            Toast.MakeText(act, "File Chooser excluded!",ToastLength.Long).Show();
            #endif
        }
开发者ID:pythe,项目名称:wristpass,代码行数:16,代码来源:Util.cs

示例4: LaunchWithoutLockCheck

        public static void LaunchWithoutLockCheck(Activity act)
        {
            Intent i = new Intent(act, typeof(GeneratePasswordActivity));

            i.PutExtra(NoLockCheck, true);

            act.StartActivityForResult(i, 0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:8,代码来源:GeneratePasswordActivity.cs

示例5: Launch

        public static void Launch(Activity act, PwGroup parentGroup)
        {
            Intent i = new Intent(act, typeof(GroupEditActivity));

            PwGroup parent = parentGroup;
            i.PutExtra(KeyParent, parent.Uuid.ToHexString());

            act.StartActivityForResult(i, 0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:9,代码来源:GroupEditActivity.cs

示例6: ShowBrowseDialog

        /// <summary>
        /// Opens a browse dialog for selecting a file.
        /// </summary>
        /// <param name="activity">context activity</param>
        /// <param name="requestCodeBrowse">requestCode for onActivityResult</param>
        /// <param name="forSaving">if true, the file location is meant for saving</param>
        /// <param name="tryGetPermanentAccess">if true, the caller prefers a location that can be used permanently
        /// This means that ActionOpenDocument should be used instead of ActionGetContent (for not saving), as ActionGetContent
        /// is more for one-time access, but therefore allows possibly more available sources.</param>
        public static void ShowBrowseDialog(Activity activity, int requestCodeBrowse, bool forSaving, bool tryGetPermanentAccess)
        {
            var loadAction = (tryGetPermanentAccess && IsKitKatOrLater) ?
                            Intent.ActionOpenDocument : Intent.ActionGetContent;
            if ((!forSaving) && (IsIntentAvailable(activity, loadAction, "*/*", new List<string> { Intent.CategoryOpenable})))
            {
                Intent i = new Intent(loadAction);
                i.SetType("*/*");
                i.AddCategory(Intent.CategoryOpenable);

                activity.StartActivityForResult(i, requestCodeBrowse);
            }
            else
            {
                if ((forSaving) && (IsKitKatOrLater))
                {
                    Intent i = new Intent(Intent.ActionCreateDocument);
                    i.SetType("*/*");
                    i.AddCategory(Intent.CategoryOpenable);

                    activity.StartActivityForResult(i, requestCodeBrowse);
                }
                else
                {
                    string defaultPath = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;

                    ShowInternalLocalFileChooser(activity, requestCodeBrowse, forSaving, defaultPath);
                }

            }
        }
开发者ID:pythe,项目名称:wristpass,代码行数:40,代码来源:Util.cs

示例7: LaunchProductDetailsActivity

 public void LaunchProductDetailsActivity(Activity activity, Product product, ProductDetailsTheme theme)
 {
     var builder = new ProductDetailsBuilder(this, BuyClient);
     var intent = builder.SetShopDomain(BuyClient.ShopDomain)
             .SetProduct(product)
             .SetTheme(theme)
             .SetShop(Shop)
             .SetWebReturnToUrl(GetString(Resource.String.web_return_to_url))
             .SetWebReturnToLabel(GetString(Resource.String.web_return_to_label))
             .Build();
     activity.StartActivityForResult(intent, 1);
 }
开发者ID:mattleibow,项目名称:shopify-bindings,代码行数:12,代码来源:SampleApplication.cs

示例8: Launch

        public static void Launch(Activity act, PwEntry pw, int pos, AppTask appTask, ActivityFlags? flags = null)
        {
            Intent i = new Intent(act, typeof(EntryActivity));

            i.PutExtra(KeyEntry, pw.Uuid.ToHexString());
            i.PutExtra(KeyRefreshPos, pos);

            if (flags != null)
                i.SetFlags((ActivityFlags) flags);

            appTask.ToIntent(i);
            if (flags != null && (((ActivityFlags) flags) | ActivityFlags.ForwardResult) == ActivityFlags.ForwardResult)
                act.StartActivity(i);
            else
                act.StartActivityForResult(i, 0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:16,代码来源:EntryActivity.cs

示例9: Launch

 public static void Launch(Activity act)
 {
     Intent i = new Intent(act, typeof(IconPickerActivity));
     act.StartActivityForResult(i, 0);
 }
开发者ID:pythe,项目名称:wristpass,代码行数:5,代码来源:IconPickerActivity.cs

示例10: Launch

        public static void Launch(Activity act, PwGroup g, AppTask appTask)
        {
            // Need to use PwDatabase since group may be null
            PwDatabase db = App.Kp2a.GetDb().KpDatabase;

            if (db == null) {
                // Reached if db is null
                Log.Debug (Tag, "Tried to launch with null db");
                return;
            }

            Intent i = new Intent(act, typeof(GroupActivity));

            if ( g != null ) {
                i.PutExtra(KeyEntry, g.Uuid.ToHexString());
            }
            appTask.ToIntent(i);

            act.StartActivityForResult(i,0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:20,代码来源:GroupActivity.cs

示例11: StartForResult

 public static void StartForResult(Activity activity, Session session, int requestCode)
 {
     var intent = CreateIntent(activity, session);
     activity.StartActivityForResult(intent, requestCode);
 }
开发者ID:amay077,项目名称:DroidKaigi2016Xamarin,代码行数:5,代码来源:SessionDetailActivity.cs

示例12: TryEnablingBluetooth

        //--------------------------------------------------------------
        // METHODS
        //--------------------------------------------------------------
        /* Activate the bluetooth to allow connection with an other device*/
        public ResultEnabling TryEnablingBluetooth(Activity activity)
        {
            #if DEBUG
            Log.Debug(Tag, "TryEnablingBluetooth()");
            #endif

            // Get local Bluetooth adapter
            BluetoothAdapter bluetoothAdapter = BluetoothAdapter.DefaultAdapter;

            // If the adapter is null, then Bluetooth is not supported
            if(bluetoothAdapter == null)
            {
                #if DEBUG
                Log.Debug(Tag, "display of the alert");
                #endif

                UtilsDialog.PopUpEndEvent += activity.Finish;
                Intent intent = UtilsDialog.CreateBluetoothDialogNoCancel(activity, Resource.String.BTNotAvailable);
                activity.StartActivity(intent);
                return ResultEnabling.NoMedium;
            }

            // If the bluetooth is not enable, we try to activate it
            if(!bluetoothAdapter.IsEnabled)
            {
                #if DEBUG
                Log.Debug(Tag, "intent to activate bluetooth");
                #endif

                Intent enableIntent = new Intent(BluetoothAdapter.ActionRequestEnable);
                activity.StartActivityForResult(enableIntent,(int) Utils.RequestCode.RequestEnableBluetooth);
                return ResultEnabling.Activation;
            }

            #if DEBUG
            Log.Debug(Tag, "creation of BluetoothManager");
            #endif

            EnableBluetooth();
            _communicationWay.Start();
            return ResultEnabling.Enabled;
        }
开发者ID:lea-and-anthony,项目名称:Tetrim,代码行数:46,代码来源:Network.cs

示例13: startTwoPlayerGame

 public static void startTwoPlayerGame(Activity activity, string opponentName)
 {
     Intent intent = new Intent(activity, typeof(GameMultiActivity));
     intent.PutExtra(Utils.OpponentNameExtra, opponentName);
     activity.StartActivityForResult(intent, (int) Utils.RequestCode.RequestGameTwoPlayer);
 }
开发者ID:lea-and-anthony,项目名称:Tetrim,代码行数:6,代码来源:MenuActivity.cs

示例14: startOnePlayerGame

 //--------------------------------------------------------------
 // PUBLIC METHODS
 //--------------------------------------------------------------
 public static void startOnePlayerGame(Activity activity)
 {
     Intent intent = new Intent(activity, typeof(GameSingleActivity));
     activity.StartActivityForResult(intent, (int) Utils.RequestCode.RequestGameOnePlayer);
 }
开发者ID:lea-and-anthony,项目名称:Tetrim,代码行数:8,代码来源:MenuActivity.cs

示例15: Launch

        public static void Launch(Activity act)
        {
            Intent i = new Intent(act, typeof(GeneratePasswordActivity));

            act.StartActivityForResult(i, 0);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:6,代码来源:GeneratePasswordActivity.cs


注:本文中的Android.App.Activity.StartActivityForResult方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。