使用<data android: 建立和activity的关联

来源:互联网 发布:弱电箱网络模块modem 编辑:程序博客网 时间:2024/05/17 10:24

新浪sdk调用分析,回调函数中指明了URL_ACTIVITY_CALLBACK = "weiboandroidsdk://TimeLineActivity";
但是是如何和TestActivity关联的呢?在AndroidManifest.xml中通过下句就可以了。

<data android:scheme="weiboandroidsdk" android:host="TimeLineActivity" />


具体如下:

<activity android:configChanges="keyboardHidden|orientation" android:name="TestActivity">
       <intent-filter>
       <action android:name="android.intent.action.VIEW" />
       <category android:name="android.intent.category.DEFAULT" />
       <category android:name="android.intent.category.BROWSABLE" />
       <data android:scheme="weiboandroidsdk" android:host="TimeLineActivity" /> 
</intent-filter>
        </activity>

原创粉丝点击