且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Facebook两次提示用户登录

更新时间:2023-02-05 20:05:44

已解决

在xml中使用标准按钮(在parse文档中提供)与使用facebook小部件按钮(在facebook文档中提供)有区别

There is a difference between using a standard button in xml (as provided in parse documentation) and using the facebook widget button (as provided in the facebook documentation)

facebook窗口小部件具有一些根深蒂固的功能,可以启动登录(不确定如何操作).

The facebook widget has some ingrained functionality that launches the login (not sure how).

标准按钮要求您附加一个侦听器,调用parse facebook登录功能.

The standard button requires you to attach a listener, call the parse facebook login function.

由于我除了小部件外还具有侦听器和parse调用,因此登录被调用了两次.

As I had the listenar and the parse call in addition to the widget, login was getting called twice.

更改了此内容:< com.facebook.widget.LoginButton .../>

changed this: < com.facebook.widget.LoginButton.../>

对此:

<Button
    android:id="@+id/fbLoginButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:layout_marginBottom="10dp"
    android:gravity="center_horizontal"
    android:background="@drawable/button_login"
    android:text="@string/login"
    android:textColor="#fff" />