当前位置: 首页 > news >正文

商城网站建设 优帮云seo关键词优化推广报价表

商城网站建设 优帮云,seo关键词优化推广报价表,网络舆情应对及处置方案,佛山网站开发哪家好背景 通过deeplink启动应用之后,没关闭应用的情况下,再次使用deeplink会失效的问题,是系统bug导致的。此bug仅在某些设备(Nexus 5X)上重现,launchMode并且仅当应用程序最初通过深层链接启动并再次通过深层…

背景

通过deeplink启动应用之后,没关闭应用的情况下,再次使用deeplink会失效的问题,是系统bug导致的。此bug仅在某些设备(Nexus 5X)上重现,launchMode并且仅当应用程序最初通过深层链接启动并再次通过深层链接打开时才会重现。
在这里插入图片描述

在AndroidManifest中像这样设置了我的活动,即MainActivity。

<activityandroid:name="com.package.name.MainActivity"android:screenOrientation="portrait"android:theme="@style/Theme.AppTheme"><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></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="myscheme" android:host="myhost" /></intent-filter>
</activity>

并且在 LaunchActivity.onCreate() 中打印一个日志来表明它已经在那里了。
使用如下测试深层链接。

adb shell am start -W -a android.intent.action.VIEW -d "dlscheme://dlhost/param" some.package.name

在应用程序被终止后,使用上述命令,它可以打开应用程序并路由到正确的活动,没有问题。并且有以下日志。

adb shell am start -W -a android.intent.action.VIEW -d "dlscheme://dlhost/param" some.package.name
Starting: Intent { act=android.intent.action.VIEW dat=dlscheme://dlhost/param pkg=some.package.name }
Status: ok
Activity: some.package.name/.activity.LaunchActivity
ThisTime: 898
TotalTime: 898
WaitTime: 919
Complete

但是,如果再次输入相同的命令,而不终止应用程序。它只会打开应用程序,但不会打开正确的活动,并生成以下日志。

adb shell am start -W -a android.intent.action.VIEW -d "dlscheme://dlhost/param" some.package.name
Starting: Intent { act=android.intent.action.VIEW dat=dlscheme://dlhost/param pkg=some.package.name }
Warning: Activity not started, its current task has been brought to the front
Status: ok
Activity: some.package.name/.activity.LaunchActivity
ThisTime: 0
TotalTime: 0
WaitTime: 6
Complete

注意到有这一行
Warning: Activity not started, its current task has been brought to the front

解决方案

在项目的清单文件中,需要将以下内容添加到MainActivity中。

android:launchMode="singleTask"

并处理内部的深层链接onNewIntent()

@Override
protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_recipe);onNewIntent(getIntent());
}protected void onNewIntent(Intent intent) {String action = intent.getAction();String data = intent.getDataString();if (Intent.ACTION_VIEW.equals(action) && data != null) {String recipeId = data.substring(data.lastIndexOf("/") + 1);Uri contentUri = RecipeContentProvider.CONTENT_URI.buildUpon().appendPath(recipeId).build();showRecipe(contentUri);}
}
http://www.yidumall.com/news/26244.html

相关文章:

  • 怎么做卖卷网站安卓优化大师app下载安装
  • 无锡企业网站制作公司有哪些开鲁网站seo转接
  • 做网站技术人员营销培训讲师
  • 做ppt比较好的网站seo网站优化建议
  • win2012服务器做网站想开个网站怎样开
  • 郴州做网站 郴网互联百度怎样发布作品
  • 南宫做网站南京网络推广外包
  • 大型网站建设的必须条件免费舆情网站下载大全最新版
  • 服务器有了网站怎么做网络推广人员是干什么的
  • 南宁本地网站设计网络推广 网站制作
  • 做网站需要准备的素材谷歌搜索关键词排名
  • 温州建设网站哪家好seo网络推广怎么做
  • 浅谈博物馆网站建设的意义外贸网站推广seo
  • 百度网站建设开场话术推广游戏赚钱的平台
  • 徐州自助建站系统可以发布推广引流的悬赏平台
  • 龙华网站制作广州市新闻最新消息
  • youku网站开发技术百度快速收录seo工具软件
  • 网站制作百度资源裤子seo关键词
  • 网站用vps做dns谷歌浏览器下载安装2022
  • 做网站开发团队免费发布信息网站大全
  • 公司设计资质排名优化软件点击
  • 村级网站模板网站维护费用一般多少钱
  • 网站开发的完整流程广告推广系统
  • 极速微网站建设cms杭州百度快照优化公司
  • 做网站要学的东西软文推广案例大全
  • 骏域网站建设专家怎么弄一个自己的网址
  • 东莞建设年审网站西安网站制作
  • 网络营销软件大全百度爱采购优化软件
  • 个人怎么做优惠券网站精准营销的案例
  • wordpress 主题调试宁波优化网站排名软件