Warning(Window already focused, ignoring focus gai

2020-03-27 05:15发布

Starting External FaceBook activity to share data causes a warning

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

and the FB activity is not seen on Foreground.

The Code i used is

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

My emulator has FaceBook Application in it.When getting Applications installed with ACTION_SEND as action filter i'm getting "com.facebook.katana.ShareLinkActivity".

So Please suggest me solution ASAP

Thanks & Regards, Sha

1条回答
Melony?
2楼-- · 2020-03-27 05:58

I resolved my problem by 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 started my Share facebook activity.

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

查看更多
登录 后发表回答