1

I am setting up my app with Facebook login and am trying to get some of the pre set strings and colors from the Facebook SDK and use them in my activity_login.xml. Something like this

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="100dp"

    android:text="@string/com_facebook_loginview_log_in_button"
    android:textColor="@color/com_facebook_loginview_text_color"
    android:textSize="@dimen/com_facebook_loginview_text_size"
    android:textStyle="bold"

    android:background="@drawable/com_facebook_button_blue"
    android:drawableLeft="@drawable/com_facebook_inverse_icon"
    android:drawablePadding="@dimen/com_facebook_likebutton_compound_drawable_padding"
    android:paddingLeft="@dimen/com_facebook_loginview_padding_left"
    android:paddingTop="@dimen/com_facebook_loginview_padding_top"
    android:paddingRight="@dimen/com_facebook_loginview_padding_right"
    android:paddingBottom="@dimen/com_facebook_loginview_padding_bottom"
    android:onClick="onLoginClick"/>

But I get an error Cant resolve symbol @string/com_facebook_loginview_log_in_button and I have imported the Facebook SDK correctly and it is good, but I can't seem to use the values?

Thanks for the help in advance. :)

iqueqiorio
  • 1,149
  • 2
  • 35
  • 78

1 Answers1

0

Is there a reason you can't use the Facebook button?

<com.facebook.widget.LoginButton
    android:id="@+id/facebook_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"/>

Make sure you import Facebook SDK into your project for this to work.

eclipse1203
  • 535
  • 4
  • 14
  • Yes cause I get this error when I use it `3650-3677/com.spencerfontein.ueat E/AndroidRuntime﹕ FATAL EXCEPTION: AsyncTask #3 java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:299)` – iqueqiorio Dec 02 '14 at 02:50
  • Are you instantiating it with a Facebook button as well? – eclipse1203 Dec 02 '14 at 02:59
  • I did this to install it http://stackoverflow.com/questions/27233722/install-facebook-sdk-in-android-studio-0-8-14. And on a side note I am just trying to setup Facebook login if you know a good tutorial or could answer that...? Thanks – iqueqiorio Dec 02 '14 at 03:03
  • I used this one a few weeks ago and it works fine. https://developers.facebook.com/docs/android/login-with-facebook/v2.2 – eclipse1203 Dec 02 '14 at 03:19