Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/facebook/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android facebook意图通过com.facebook.katana.ProfileTabHostActivity类显示个人资料;我不再工作了_Android_Facebook_Android Intent - Fatal编程技术网

Android facebook意图通过com.facebook.katana.ProfileTabHostActivity类显示个人资料;我不再工作了

Android facebook意图通过com.facebook.katana.ProfileTabHostActivity类显示个人资料;我不再工作了,android,facebook,android-intent,Android,Facebook,Android Intent,可能重复: 直到几天前,为了向我的用户显示另一个用户配置文件,我使用了以下解决方案: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName("com.facebook.katana", "com.facebook.katana.ProfileTabHostActivity"); Long uid = new Long("123456789"); intent.putExtra("extra_user_id", u

可能重复:

直到几天前,为了向我的用户显示另一个用户配置文件,我使用了以下解决方案:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName("com.facebook.katana", "com.facebook.katana.ProfileTabHostActivity");
Long uid = new Long("123456789");
intent.putExtra("extra_user_id", uid);
startActivity(intent);
很多stackoverflow用户都使用这个解决方案(从看到关于这个主题的所有问题和答案开始)

上一次facebook应用程序更新(1.9.11),甚至可能在更新之前就已经让这个解决方案过时了。 现在,您将获得以下异常:

java.lang.SecurityException:权限拒绝:启动意图{ act=android.intent.action.VIEW cmp=com.facebook.katana/.ProfileTabHostActivity(有额外功能)}来自 进程记录。。。需要空值

有人知道我现在如何打开facebook应用程序吗


谢谢

问题中描述的解决方案不再有效(在编辑此问题时,您可以查看原因的详细信息)。新版本的facebook应用程序不再支持这种意图。请参阅错误报告

新的解决方案是使用iphonescheme机制(是的,facebook决定在Android中支持iPhone机制,而不是Android的隐式意图机制)

因此,要使用用户档案打开facebook应用程序,您需要做的就是:

String facebookScheme = "fb://profile/" + facebookId;
Intent facebookIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(facebookScheme)); 
startActivity(facebookIntent);
如果您正在寻找其他操作,您可以使用用于所有可用操作的(但您必须对其进行测试,因为我没有找到facebook的官方出版物)

编辑 问题的这一部分提供了有关问题性质和解决方案的更多细节,但以上细节足以解决问题

新版本的facebook应用程序更改了清单文件。 今天的活动

com.facebook.katana.ProfileTabHostActivity

以以下方式在清单中描述:

<activity android:theme="@style/Theme.Facebook"
android:name="com.facebook.katana.ProfileTabHostActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout"
android:windowSoftInputMode="adjustPan" />
)我想感谢您提供有关导出值的详细信息

但新版本具有以下活动:

<activity android:name="com.facebook.katana.IntentUriHandler">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="facebook" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="fb" />
        </intent-filter>
    </activity>

在这里你可以看到他们支持fb和facebook计划