onNewIntent()将不会调用在Android的标签 [英] onNewIntent() is not called in android Tabs

查看:268
本文介绍了onNewIntent()将不会调用在Android的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个应用程序。在我的应用程序有三个选项卡。在第3个选项卡我已经实现了使用他们的SDK一些LinkedIn的整合,使用户​​可以在自己的LinkedIn账户墙分享。

I am working on one application. In my application I have three tabs. In the 3rd tab I have implemented some LinkedIn integration using their SDK, so that user can share on his LinkedIn account wall.

似乎一切都工作正常,如果我不使用内部选项卡此code。但是,如果我结合使用LinkedIn的SDK里面的选项卡,然后在code onNewIntent()未燃。

Everything seems to be working fine if I don't use this code inside tabs. But if I integrate the code that uses the LinkedIn SDK inside tabs, then onNewIntent() is not fired.

我整合LinkedIn这样的:

I am integrating LinkedIn like this:

        Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(liToken.getAuthorizationUrl()));
        i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
        startActivity(i);

基本上,它会打开一个网页,回来时,它重新启动我的$ P $从那里我叫LinkedIn的SDK pvious活动,但无标签的底部。

It basically opens a web page and when comes back it restarts my previous activity from where i called the LinkedIn SDK, but having no tabs at the bottom.

我想我的应用程序来我previous活动,和 onNewIntent()应,即使我的code被移动内部标签调用。我怎样才能实现呢?

I want my app to come to my previous activity, and onNewIntent() should be called even when my code is moved inside tabs. How can I achieve it?

感谢

推荐答案

我发现onNewIntent在文档中的说明,如果两个launchMode =singleTop和Intent.FLAG_ACTIVITY_SINGLE_TOP被设置好的就会被调用。

I found that onNewIntent will be called as described in documentation if both launchMode="singleTop" and Intent.FLAG_ACTIVITY_SINGLE_TOP are setted.

这篇关于onNewIntent()将不会调用在Android的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆