Android 与活动的直接链接

Android 与活动的直接链接,android,android-intent,Android,Android Intent,我有一个类似于a(家庭活动)的活动结构,它导航到B,它导航到C。根据以下伪代码,C也有一个通过外部启动器(如NFC或HTTP)的直接链接: <activity "C" <intent-filter android:label="@string/filter_title_viewgizmos"> <data android:scheme="http" android:host="www.example.com"

我有一个类似于a(家庭活动)的活动结构,它导航到B,它导航到C。根据以下伪代码,C也有一个通过外部启动器(如NFC或HTTP)的直接链接:

<activity "C"
    <intent-filter android:label="@string/filter_title_viewgizmos">
        <data android:scheme="http"
              android:host="www.example.com"
              android:pathPrefix="gizmos" />
...

但它似乎没有解决这个特殊情况,除非我遗漏了什么。

你的应用程序总是从主活动开始,除非是出于意图调用它。如果您想更改此行为,您可以在Activity a onCreate中读取的设置中存储一个键(如a、B或C),以便从此处调用另一个Activity。

我甚至会说您应该有另一个Activity,如LaunchDispatcher,用于决定是否转到a,B或C,并确保适当设置其标志,以使其不会放在后堆栈中