反编译qq清单文件,发现点:
com.tencent.mobileqq.activity.JumpActivity ForwardRecentActivity
com.tencent.mobileqq.activity. ForwardFriendListActivity
1.android:alwaysRetainTaskState="true"
http://blog.sina.com.cn/s/blog_5de73d0b0102vpai.html
2.Android相关属性的介绍:android:exported = true
https://blog.csdn.net/u010164190/article/details/51263000
3.android:configChanges="locale"
https://blog.csdn.net/garybook/article/details/17025087
根据微信文档-采用第三方文件打开--选择qq,执行分享流程,查看ActivityManager TAG的日志,获取到下面的log信息
START u0 {act=android.intent.action.VIEW dat=file:///storage/emulated/0/Tencent/QQfile_recv/zookeeper3.4.1安装文档.docx typ=application/vnd.openxmlformats-officedocument.wordprocessingml.document flg=0x50000000 cmp=com.tencent.mobileqq/.activity.JumpActivity (has extras)} from uid 10134 on display 0 07-25 14:10:56.094 1424-8926/? D/ActivityManager: realStartActivityLocked -- app = ProcessRecord{2aedb64 2117:com.tencent.mobileqq/u0a136}, r= ActivityRecord{db2e5a5 u0 com.tencent.mobileqq.activity.JumpActivity t1469} 07-25 14:10:56.113 1424-8926/? I/ActivityManager: dispatchActivityResumed for activity com.tencent.mobileqq/com.tencent.mobileqq.activity.JumpActivity uid 10136 07-25 14:10:56.139 1424-3639/? I/ActivityManager: START u0 {dat=file:///storage/emulated/0/Tencent/QQfile_recv/zookeeper3.4.1安装文档.docx flg=0x40000 cmp=com.tencent.mobileqq/.activity.ForwardRecentActivity (has extras)} from uid 10136 on display 0 07-25 14:10:56.158 1424-3115/? D/ActivityManager: realStartActivityLocked -- app = ProcessRecord{2aedb64 2117:com.tencent.mobileqq/u0a136}, r= ActivityRecord{b0701d2 u0 com.tencent.mobileqq/.activity.ForwardRecentActivity t1469} 07-25 14:10:56.175 1424-3115/? I/ActivityManager: dispatchActivityResumed for activity com.tencent.mobileqq/com.tencent.mobileqq.activity.ForwardRecentActivity uid 10136 07-25 14:10:56.348 1424-1544/? I/ActivityManager: Displayed com.tencent.mobileqq/.activity.ForwardRecentActivity: +193ms (total +263ms)
根据上面信息,可以看出,微信文档,采用qq分享时,先是跳转到了JumpActivity 界面,然后跳转到了最近聊天,可以选择好友的列表。
为了能看到qq实现获取分享文件的代码。进行反编译后,找到清单文件。
参照qq清单文件。也在自己的项目中新建了JumpActivity 清单文件配置如下。
<activity android:configChanges="locale|keyboardHidden|orientation" android:name="app.activity.JumpActivity" android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent"> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqq"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqapi"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="qqstory"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqmdpass"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqwpa"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="http"/> <data android:host="clientui.3g.qq.com"/> <data android:pathPrefix="/"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:host="qm.qq.com" android:scheme="http"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqopensdkapi"/> </intent-filter> <intent-filter android:label="@string/wx_share"> <action android:name="android.intent.action.SEND"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> <data android:mimeType="video/*"/> <data android:mimeType="audio/*"/> <data android:mimeType="application/*"/> <data android:mimeType="text/plain"/> <data android:mimeType="text/html"/> <data android:mimeType="text/css"/> <data android:mimeType="text/xml"/> <data android:mimeType="text/csv"/> <data android:mimeType="text/x-vcard"/> </intent-filter> <intent-filter android:label="@string/wx_share"> <action android:name="android.intent.action.SEND_MULTIPLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqflyticket"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="wtloginmqq"/> </intent-filter> <intent-filter android:label="@string/wx_share"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="file"/> <data android:mimeType="image/*"/> <data android:mimeType="video/*"/> <data android:mimeType="audio/*"/> <data android:mimeType="text/*"/> <data android:mimeType="application/x-7z-compressed"/> <data android:mimeType="application/msword"/> <data android:mimeType="application/octet-stream"/> <data android:mimeType="application/pdf"/> <data android:mimeType="application/vnd.mophun.application"/> <data android:mimeType="application/vnd.mpohun.certificate"/> <data android:mimeType="application/vnd.ms-excel"/> <data android:mimeType="application/vnd.ms-powerpoint"/> <data android:mimeType="application/vnd.ms-project"/> <data android:mimeType="application/x-autocad"/> <data android:mimeType="application/x-gtar"/> <data android:mimeType="application/x-gzip"/> <data android:mimeType="application/x-msaccess"/> <data android:mimeType="application/x-mscardfile"/> <data android:mimeType="application/x-msclip"/> <data android:mimeType="application/x-msmediaview"/> <data android:mimeType="application/x-msmetafile"/> <data android:mimeType="application/x-msmoney"/> <data android:mimeType="application/x-mspublisher"/> <data android:mimeType="application/x-msschedule"/> <data android:mimeType="application/x-msterminal"/> <data android:mimeType="application/x-ms-wmd"/> <data android:mimeType="application/x-ms-wmz"/> <data android:mimeType="application/x-mswrite"/> <data android:mimeType="application/x-rar-compressed"/> <data android:mimeType="application/x-shockwave-flash"/> <data android:mimeType="application/x-tar"/> <data android:mimeType="application/zip"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.template"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"/> <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template"/> </intent-filter> <intent-filter android:label="@string/wx_share"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="image/*"/> <data android:mimeType="video/*"/> <data android:mimeType="audio/*"/> <data android:mimeType="text/*"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.SENDTO"/> <category android:name="android.intent.category.DEFAULT"/> <data android:host="qq" android:scheme="imto"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:host="tribe" android:scheme="mqqtribe"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:host="puzzle_verify_code" android:scheme="mqqverifycode"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqdevlock"/> </intent-filter> <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="qapp"/> </intent-filter> <intent-filter> <action android:name="com.tencent.mobileqq.msf.qqwifi.missions"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <intent-filter> <action android:name="com.tencent.mobileqq.msf.qqwifi.map"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <intent-filter> <action android:name="com.tencent.mobileqq.msf.qqwifi.redtouch"/> <category android:name="android.intent.category.DEFAULT"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="qqwifi"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="apollo"/> </intent-filter> <intent-filter> <action android:name="android.nfc.action.TECH_DISCOVERED"/> </intent-filter> <!--<meta-data android:name="android.nfc.action.TECH_DISCOVERED" android:resource="@xml/name"/>--> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqconnect"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqzone"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqzonev2"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqzonev3"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqconferenceflyticket"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="kandianugc"/> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="mqqdatamigration"/> </intent-filter> </activity>
参照qq,也将分享跳转的两个Activity界面,添加了 android:alwaysRetainTaskState="true"属性。
再次测试,可以解决了微信打开文档后,----选择第三方应用打开---选择自己的项目,可以保证,先从JumpActivity跳转到--列表选择界面--选择好友---然后返回到最近聊天界面,其中列表选择界面不会onDestroy。
通过反编译:根据qq清单文件也学到了好几点东西。