Warning(Window already focused, ignoring focus gain).Starting Facebook App from external Activity

烂漫一生 提交于 2019-12-30 11:09:32

问题


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:


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"



来源:https://stackoverflow.com/questions/6042871/warningwindow-already-focused-ignoring-focus-gain-starting-facebook-app-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!