本文整理汇总了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);
}
}
示例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);
}
示例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
}
示例4: LaunchWithoutLockCheck
public static void LaunchWithoutLockCheck(Activity act)
{
Intent i = new Intent(act, typeof(GeneratePasswordActivity));
i.PutExtra(NoLockCheck, true);
act.StartActivityForResult(i, 0);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例9: Launch
public static void Launch(Activity act)
{
Intent i = new Intent(act, typeof(IconPickerActivity));
act.StartActivityForResult(i, 0);
}
示例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);
}
示例11: StartForResult
public static void StartForResult(Activity activity, Session session, int requestCode)
{
var intent = CreateIntent(activity, session);
activity.StartActivityForResult(intent, requestCode);
}
示例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;
}
示例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);
}
示例14: startOnePlayerGame
//--------------------------------------------------------------
// PUBLIC METHODS
//--------------------------------------------------------------
public static void startOnePlayerGame(Activity activity)
{
Intent intent = new Intent(activity, typeof(GameSingleActivity));
activity.StartActivityForResult(intent, (int) Utils.RequestCode.RequestGameOnePlayer);
}
示例15: Launch
public static void Launch(Activity act)
{
Intent i = new Intent(act, typeof(GeneratePasswordActivity));
act.StartActivityForResult(i, 0);
}