If you look at line 99 in the Facebook Validate class, you will see that it throws a FacebookSdkNotInitializedException
You need to call FacebookSdk.sdkInitialize(Context) before loading LoginButton (i.e. your call to setContentView() )
So, in your Activity onCreate method:
public void onCreate(Bundle savedInstance){ super.onCreate(savedInstance); FacebookSdk.sdkInitialize(getApplicationContext()); setContentView(R.layout.my_layout);
Anytime you intend to use the components of Facebook, you need to make sure that the SDK is initialized.
Also make sure that you have a metadata key for your Facebook application identifier in the manifest, otherwise you will encounter another problem when trying to actually click the LoginButton button.
source share