I m trying to integrate the facebook in my app.I am using facebook example app downloaded from facebook as a reference(also generated the appId
and all this process on developer.facebook).I am little lazy so I do not want to go through all the code of facebook sdk.In simple words i just add the com_android_facebook
library project in my app, and also copy all the classes in facebook example app in my app except Example.java
Now i modify the MyActivity class look like Example.java class, means MyActivity now have all the code of Example class and also my main Activity.
and i change the layout of my app as
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textSize="22px"
android:textColor="#ff00ff"
android:gravity="center"
>
</TextView>
<com.android.facebook.LoginButton
android:id="@+id/login"
android:src="@drawable/login"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
/>
<Button android:id="@+id/uploadButton"
android:text="@string/upload"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_margin="20dp"
/>
<Button android:id="@+id/requestButton"
android:text="@string/request"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_margin="20dp"
/>
<Button android:id="@+id/postButton"
android:text="@string/post"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_margin="20dp"
/>
<Button android:id="@+id/deletePostButton"
android:text="@string/delete"
android:visibility="invisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:layout_margin="20dp"
/>
</RelativeLayout>
Now when i run my app i am getting there errors
10-14 00:58:37.786: ERROR/AndroidRuntime(3971): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.myapp/com.android.myapp.MyActivity}: android.view.InflateException: Binary XML file line #21: Error inflating class com.android.facebook.LoginButton
10-14 00:58:37.786: ERROR/AndroidRuntime(3971): Caused by: android.view.InflateException: Binary XML file line #21: Error inflating class com.android.facebook.LoginButton
10-14 00:58:37.786: ERROR/AndroidRuntime(3971): Caused by: java.lang.ClassNotFoundException: com.android.facebook.LoginButton in loader dalvik.system.PathClassLoader@44c06850
Any help, suggestions are most welcome...