Activity.startNextMatchingActivity(Intent) 方法的用法是什么?
What is the usage of the method Activity.startNextMatchingActivity(Intent)?
API 表示 "You can use this to hand the Intent off to the next Activity that can handle it. "。但是我们可以使用 startActivity(getIntent()) 来做到这一点 too.What 有区别吗?
看看文档是怎么说的:
startNextMatchingActivity
Special version of starting an activity, for use when you are
replacing other activity components. You can use this to hand the
Intent off to the next Activity that can handle it. You typically call
this in onCreate(Bundle) with the Intent returned by getIntent().
参数
intent 发送到下一个 activity 的意图。对于正确的行为,这必须与启动您自己的 Intent 相同 activity;您唯一可以做的改变就是它里面的附加功能。
选项 Activity 应该如何启动的附加选项。有关更多详细信息,请参阅 Context.startActivity(Intent, Bundle)。
Returns
Returns a boolean indicating whether there was another Activity to
start: true if there was a next activity to start, false if there
wasn't. In general, if true is returned you will then want to call
finish() on yourself.
API 表示 "You can use this to hand the Intent off to the next Activity that can handle it. "。但是我们可以使用 startActivity(getIntent()) 来做到这一点 too.What 有区别吗?
看看文档是怎么说的:
startNextMatchingActivity
Special version of starting an activity, for use when you are replacing other activity components. You can use this to hand the Intent off to the next Activity that can handle it. You typically call this in onCreate(Bundle) with the Intent returned by getIntent().
参数
intent 发送到下一个 activity 的意图。对于正确的行为,这必须与启动您自己的 Intent 相同 activity;您唯一可以做的改变就是它里面的附加功能。
选项 Activity 应该如何启动的附加选项。有关更多详细信息,请参阅 Context.startActivity(Intent, Bundle)。
Returns
Returns a boolean indicating whether there was another Activity to start: true if there was a next activity to start, false if there wasn't. In general, if true is returned you will then want to call finish() on yourself.