OnNewIntent () not called in Android tabs

I am working on one application. I have three tabs in my application. On the third tab, I implemented some LinkedIn integration using their SDKs so that the user can share on their LinkedIn account wall.

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

I integrate LinkedIn as follows:

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

It basically opens the web page, and when it returns, it restarts my previous activity, from where I called the LinkedIn SDK, but it does not have tabs at the bottom.

I want my application to go back to my previous action, and onNewIntent() should be called even when my code moves inside tabs. How can i achieve this?

thanks

+4
source share
2 answers

Set your actions launchMode = "singleTop" in AndroidManifest.xml instead?

0
source

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

0
source

Source: https://habr.com/ru/post/1390181/


All Articles