https://developers.facebook.com/docs/howtos/androidsdk/3.0/login-with-facebook/#step3のチュートリアルを読みました。ただし、チュートリアルでは、ログイン ボタンをフラグメントに入れています。ログイン ボタン ウィジェットを既存のアクティビティ レイアウトに直接配置したいと考えています。例えば、
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- other layout for my activity -->
<com.facebook.widget.LoginButton
android:id="@+id/authButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
/>
</LinearLayout>
私はそうしようとしましたが、無駄でした (ログインボタンのクラッシュまたは不正なログインステータス)。または、Activity レイアウトにフラグメントを配置することは可能ですか?