Step 1: First add FrameLayout and make facebook button visibility="gone" and add your . Get rid of all references to the "LoginButton" in your Java code..