Activity.StartActivityIfNeeded メソッド

定義

オーバーロード

名前 説明
StartActivityIfNeeded(Intent, Int32)

オプションなしで #startActivityIfNeeded(Intent, int, Bundle) を呼び出すのと同じです。

StartActivityIfNeeded(Intent, Int32, Bundle)

特定のインテントを処理するために新しいアクティビティ インスタンスが必要な場合にのみ、アクティビティを起動する特別なバリエーション。

StartActivityIfNeeded(Intent, Int32)

オプションなしで #startActivityIfNeeded(Intent, int, Bundle) を呼び出すのと同じです。

[Android.Runtime.Register("startActivityIfNeeded", "(Landroid/content/Intent;I)Z", "GetStartActivityIfNeeded_Landroid_content_Intent_IHandler")]
public virtual bool StartActivityIfNeeded(Android.Content.Intent intent, int requestCode);
[<Android.Runtime.Register("startActivityIfNeeded", "(Landroid/content/Intent;I)Z", "GetStartActivityIfNeeded_Landroid_content_Intent_IHandler")>]
abstract member StartActivityIfNeeded : Android.Content.Intent * int -> bool
override this.StartActivityIfNeeded : Android.Content.Intent * int -> bool

パラメーター

intent
Intent

開始する意図。

requestCode
Int32

>= 0 の場合、アクティビティが終了すると、このコードは onActivityResult() で返されます。< 0 の場合、#startActivityForResultで説明されているように、アクティビティが終了しても結果は返されません。

返品

新しいアクティビティが起動された場合は true が返されます。それ以外の場合は false が返され、意図を自分で処理する必要があります。

属性

注釈

オプションなしで #startActivityIfNeeded(Intent, int, Bundle) を呼び出すのと同じです。

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

こちらもご覧ください

  • <xref:Android.App.Activity.StartActivityForResult(Android.Content.Intent%2c+System.Int32)>

適用対象

StartActivityIfNeeded(Intent, Int32, Bundle)

特定のインテントを処理するために新しいアクティビティ インスタンスが必要な場合にのみ、アクティビティを起動する特別なバリエーション。

[Android.Runtime.Register("startActivityIfNeeded", "(Landroid/content/Intent;ILandroid/os/Bundle;)Z", "GetStartActivityIfNeeded_Landroid_content_Intent_ILandroid_os_Bundle_Handler")]
public virtual bool StartActivityIfNeeded(Android.Content.Intent intent, int requestCode, Android.OS.Bundle? options);
[<Android.Runtime.Register("startActivityIfNeeded", "(Landroid/content/Intent;ILandroid/os/Bundle;)Z", "GetStartActivityIfNeeded_Landroid_content_Intent_ILandroid_os_Bundle_Handler")>]
abstract member StartActivityIfNeeded : Android.Content.Intent * int * Android.OS.Bundle -> bool
override this.StartActivityIfNeeded : Android.Content.Intent * int * Android.OS.Bundle -> bool

パラメーター

intent
Intent

開始する意図。

requestCode
Int32

>= 0 の場合、アクティビティが終了すると、このコードは onActivityResult() で返されます。< 0 の場合、#startActivityForResultで説明されているように、アクティビティが終了しても結果は返されません。

options
Bundle

アクティビティを開始する方法に関する追加のオプション。 詳細については、「 android.content.Context#startActivity(Intent, Bundle) Context.startActivity(Intent, Bundle)} 」を参照してください。

返品

新しいアクティビティが起動された場合は true が返されます。それ以外の場合は false が返され、意図を自分で処理する必要があります。

属性

注釈

特定のインテントを処理するために新しいアクティビティ インスタンスが必要な場合にのみ、アクティビティを起動する特別なバリエーション。 つまり、これは #startActivityForResult(Intent, int) と同じですが、 Intent#FLAG_ACTIVITY_SINGLE_TOP フラグ、singleTask、singleTop android.R.styleable#AndroidManifestActivity_launchMode launchModeを使用していて、 <var>intent</var> を処理するアクティビティが現在実行中のアクティビティと同じである場合、新しいインスタンスは必要ありません。 この場合、この関数を呼び出す通常の動作 #onNewIntent 代わりに返され、意図を自分で処理できます。

この関数は、最上位レベルのアクティビティからのみ呼び出すことができます。子アクティビティから呼び出されると、ランタイム例外がスローされます。

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

こちらもご覧ください

  • <xref:Android.App.Activity.StartActivityForResult(Android.Content.Intent%2c+System.Int32)>

適用対象