Warning (The window is already focused, ignoring focus enhancement). Launching Facebook application from external activity

Running external FaceBook sharing activity triggers a warning

WARN/InputManagerService(52): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@438edb68 

and FB activity is not visible on Foreground.

Code used

 Intent sendShareIntent = new Intent("com.facebook.katana"); sendShareIntent.setComponent(new ComponentName("com.facebook.katana", "com.facebook.katana.ShareLinkActivity")); startActivity(sendShareIntent); 

My emulator has a FaceBook app. When I get apps installed with ACTION_SEND as an action filter, I get "com.facebook.katana.ShareLinkActivity".

So, offer me a solution as soon as possible

Thanks and Regards, Sha

+2
source share
1 answer

I solved the problem using this piece of code.

  Intent sendShareIntent = new Intent(Intent.ACTION_SEND); sendShareIntent.setClassName("com.facebook.katana", "com.facebook.katana.ShareLinkActivity"); sendShareIntent.setType("text/*"); sendShareIntent.putExtra(android.content.Intent.EXTRA_TEXT, "http://www.google.com/"); startActivity(sendShareIntent); 

This is the beginning of my facebook activity.

For twitter, the package is "com.twitter.android" and the class is "com.twitter.android.PostActivity"

0
source

All Articles