【发布时间】:2018-10-18 09:50:33
【问题描述】:
我在清单中有一个具有此意图的活动:
<activity
android:name=".view.MainActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
<intent-filter>
<data android:scheme="http" android:host="mc8.eu"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
如果我收到带有此方案的短信,如果我点击 url,活动就会正确打开。
我需要了解活动是由意图打开还是由另一个应用活动打开。
我尝试使用此代码:
@Override
protected void onResume() {
super.onResume();
Uri ref = getReferrer();
}
但是 getReferrer 总是返回 null。
【问题讨论】:
标签: android android-intent referrer