Activity.SetIntent(Intent, ComponentCaller) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
更改返回的 #getIntent意向,并更改由 ComponentCaller 返回的 #getCaller意向。
[Android.Runtime.Register("setIntent", "(Landroid/content/Intent;Landroid/app/ComponentCaller;)V", "GetSetIntent_Landroid_content_Intent_Landroid_app_ComponentCaller_Handler", ApiSince=35)]
public virtual void SetIntent(Android.Content.Intent? newIntent, Android.App.ComponentCaller? newCaller);
[<Android.Runtime.Register("setIntent", "(Landroid/content/Intent;Landroid/app/ComponentCaller;)V", "GetSetIntent_Landroid_content_Intent_Landroid_app_ComponentCaller_Handler", ApiSince=35)>]
abstract member SetIntent : Android.Content.Intent * Android.App.ComponentCaller -> unit
override this.SetIntent : Android.Content.Intent * Android.App.ComponentCaller -> unit
参数
- newIntent
- Intent
要从中返回的新 Intent 对象 #getIntent
- newCaller
- ComponentCaller
要从中返回的新 ComponentCaller 对象 #getCaller
- 属性
注解
更改 getIntent()返回的意向,并更改 getCaller 返回的 ComponentCaller()。 这会保留对给定意向和 ComponentCaller 的引用;它不会复制它们。 通常与 onNewIntent(Intent)结合使用。 若要从 onNewIntent(Intent)检索调用方,请使用 getCurrentCaller(),否则重写 onNewIntent(Intent,ComponentCaller)。
另请参阅:
Android 参考。android.app.Activity.setIntent
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。