本篇文章主要记录解决:

微信打开文档后,----选择第三方应用打开---选择自己的项目,跳转到--列表选择界面--选择好友---然后返回到最近聊天界面,其中列表选择界面onDestroy的问题。

反编译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清单文件也学到了好几点东西。

微信文档采用第三方方式打开选择qq的更多相关文章

  1. 操作xml文档的常用方式

    1.操作XML文档的两种常用方式: 1)使用XmlReader类和XmlWriter类操作 XmlReader是基于数据流的,占用极少的内存,是只读方式的,所以速度极快.只能采用遍历的模式查找数据节点 ...

  2. Sandcastle Help File Builder(.NET帮助文档工具)的版本选择心得——支持VS2010至VS2015,高版本项目文件问题

    作者: zyl910 一.缘由 "Sandcastle Help File Builder"(简称SHFB)是一个很好用.NET 帮助文档生成工具. 但它的每个版本支持的VS版本范 ...

  3. KDE-解决.docx .xlsx .pptx文档默认由Ark打开的问题

    安装KDE后,默认的压缩解压程序变成了Ark,并且原来默认用WPS Office打开的.docx .xlsx .pptx文档,从文件管理器双击打开时,也变成了用Ark打开. 查了下网上的资料,可通过如 ...

  4. OFFICE文档(DOC,XLS,PPT)打开报错的解决办法!

    一般情况下,打开OFFICE文档报错都是因为模板文件出错!! 至于为什么会出错这个问题不好说,可能是不正确关闭文档等等,重装OFFICE也不一定能解决问题! 出现这种情况一般是所有的Word文档或者E ...

  5. sharepoint 2013 文档库 资源管理器打开报错 在文件资源管理器中打开此位置时遇到问题,将此网站添加到受信任站点列表,然后重试。

    我们在使用sharepoint 2013的文档库或者资源库的时候,经常会需要用到使用“资源管理器”来管理文档,但是有时候,点击“使用资源管理器打开”,会提示如下错误: 在文件资源管理器中打开此位置时遇 ...

  6. spring的jar包以及相关的API文档的下载方式

    转自:http://blog.csdn.net/yuexianchang/article/details/53583327 侵删 感谢原创 首先是进入官网:https://spring.io/ 如图所 ...

  7. IOS 预览word文档的集中方式

    在iPhone中可以很方便的预览文档文件,如:pdf.word等等,这篇文章将以PDF为例.介绍三种预览PDF的方式,又分别从本地pdf文档和网络上的pdf文档进行对比. 预览本地PDF文档: 1.使 ...

  8. IOS 预览pdf,word文档的集中方式

    在iPhone中可以很方便的预览文档文件,如:pdf.word等等,这篇文章将以PDF为例.介绍三种预览PDF的方式,又分别从本地pdf文档和网络上的pdf文档进行对比. 预览本地PDF文档: 1.使 ...

  9. java 在线拆分 word文档采用什么技术比较好?

    在Java项目开发中,偶尔会遇到通过程序动态拆分word文档的需求,由于Java本身不能操作Word文档,在网上也都是讨论如何动态合并word,所以这个需求实现起来相当困难,下面就将近期对于Word文 ...

随机推荐

  1. day3----编码-集合-深浅copy-文件操作-函数初识

    本文档主要内容: 一 编码 二 集合 三 深浅copy 四 文件操作 五 函数初识 首先,我们来看看两个字符串的比较 打开cmd,进入dos界面 >>>a='xingchen@' & ...

  2. android 开发 实现一个app的引导页面,使用ViewPager组件(此引导的最后一页的Button会直接写在最后一页布局里,跟随布局滑进滑出)

    基本ViewPager组件使用方式与我之前写的https://blog.csdn.net/qq_37217804/article/details/80332634 这篇博客一致. 下面我们将重点详细解 ...

  3. 27.纯 CSS 创作一个精彩的彩虹 loading 特效

    原文地址:https://segmentfault.com/a/1190000014939781 感想:正方形->圆->旋转一定角度->动画->隐藏下一半 HTML代码: &l ...

  4. 1.1使用java数组,并开始封装我们自己的数组

    今天感冒了,全身酸软无力,啥样不想做,就来学习吧,此节我们从初步使用java中提供的数组,然后分析相关情况,过渡到封装我们自己的数组. 一.我们先来感受一下java提供的数组,以整型数组(int[]) ...

  5. 作为sort()方法的参数的比较函数(高程三第五章)

    <script> var nums = [0,1,5,10,15]; var nums2 = nums; nums.sort(); console.log(nums);//0,1,10,1 ...

  6. scrapy爬行乌云网公开漏洞程序的分析

    # -*- coding: utf-8 -*- from datetime import datetime import pymongo import scrapy from wooyun.items ...

  7. 05.linux目录结构

      bin  存放二进制可执行文件(ls,cat,mkdir等)   boot  存放用于系统引导时使用的各种文件   dev 用于存放设备文件   etc  存放系统配置文件   home 存放所有 ...

  8. leetcode1009

    class Solution: def bitwiseComplement(self, N: int) -> int: if N==0: return 1 elif N==1: return 0 ...

  9. 网站优化--减少HTTP请求

    发送HTTP请求需要经过几个过程 域名解析--TCP连接--发送请求--等待--下载资源--解析时间 这其中需要花费一定时间,因此,尽可能的需要减少网站的HTTP请求,方法有以下几种: 1 . css ...

  10. PHP 文件操作类(转载)

    <?php class File { /** * 创建多级目录 * @param string $dir * @param int $mode * @return boolean */ publ ...