My xml looks like this
<com.facebook.login.widget.LoginButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fb_login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="CONNECT WITH FACEBOOK"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
android:background="@drawable/button_fb_login"/>
and background drawble xml is
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape>
<solid android:color="#4e69a2" />
<stroke android:width="3dip" android:color="#4e69a2" />
<padding android:bottom="0dip" android:left="0dip" android:right="0dip" android:top="0dip" />
</shape>
</item>
<item>
<shape>
<solid android:color="#3b5998" />
<stroke android:width="3dip" android:color="#3b5998" />
<padding android:bottom="0dip" android:left="0dip" android:right="0dip" android:top="0dip" />
</shape>
</item>
Now in android studio preview screen it shows as expected.
But when I run it on my phone or emulator, it shows "LOG IN WITH FACEBOOK" by default, like this
How do I get my custom text on running the application?
use
facebook:login_text
andfacebook:logout_text
If the above doesnt work, try to add following in your values folder
Update: Possible cause
https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/com/facebook/login/widget/LoginButton.java#L599
Update 2: Possible Solution
Override those strings in your
strings.xml
Other strings can be found here
Just need change the attribute accordingly. Refer to : this
eg: