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

意図: 開始する意図。 この値は null にすることはできません。

requestCode
Int32

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

返品

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

属性

注釈

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

関連項目も参照:

android.app.Activity.startActivityIfNeededの Android リファレンス。

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

適用対象

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

意図: 開始する意図。 この値は null にすることはできません。

requestCode
Int32

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

options
Bundle

バンドル: アクティビティを開始する方法の追加オプション。 詳細については、android.content.Context.startActivity(Intent,Bundle) Context.startActivity(Intent, Bundle)} を参照してください。 この値は null である可能性があります。

返品

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

属性

注釈

特定のインテントを処理するために新しいアクティビティ インスタンスが必要な場合にのみ、アクティビティを起動する特別なバリエーション。 つまり、これは startActivityForResult(Intent,int) に似ていますが、Intent.FLAG_ACTIVITY_SINGLE_TOP フラグまたは singleTask または singleTop launchMode を使用していて、意図を処理するアクティビティが現在実行中のアクティビティと同じである場合、新しいインスタンスは必要ありません。 この場合、OnNewIntent(Intent) を呼び出す通常の動作の代わりに、この関数が返され、意図を自分で処理できます。 この関数は、最上位レベルのアクティビティからのみ呼び出すことができます。子アクティビティから呼び出されると、ランタイム例外がスローされます。

関連項目も参照:

android.app.Activity.startActivityIfNeededの Android リファレンス。

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

適用対象