我的AndroidManifest.xml中有这个
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="http"/>
</intent-filter>
但是当我打电话时:
Intent i = currentActivity.getIntent();
Log.d("Logging", "i.getAction() is " + i.getCategories());
Log.d("Logging", "i.getAction() is " + i.getAction());
Log.d("Logging", "i.getData() is " + i.getData());
Log.d("Logging", "scheme is " + i.getScheme());
我得到了回复:
D/Logging( 5050): i.getAction() is [android.intent.category.LAUNCHER]
D/Logging( 5050): i.getAction() is android.intent.action.MAIN
D/Logging( 5050): i.getData() is null
D/Logging( 5050): scheme is null
有什么想法?
答案 0 :(得分:0)
你应该尝试在数据中指定android:host="somehost.com"
,单独的方案没有任何意义,可能会被跳过并被忽略,如果你指定url / host而没有方案,那么这些也将被忽略。