I am using this method to perform a Facebook login without using the fb button Facebook authentication without login button
It's working fine, but a progress bar with black background is shown during fb login, I guess from activity com.facebook.LoginActivity
How can I avoid displaying that activity?, I just want to show my own progress from my app activity during login in com.facebook.LoginActivity
Simple solution just show progressbar in registercallback
See my code
To further @VM4's excellent answer I modified their approach for it to work correctly with SDK version 4.12.0
Firstly I added the following to
AndroidManifest.xml
In Android Studio 2.2, it is likely that Manifest Merging may produce an error complaining that the
android:theme
cannot be overridden as it already exists. This can be resolved usingtools:replace="android:theme"
in the<activity>
tag.I created a custom style within
/res/values/styles.xml
This correctly removed the hideous Facebook progress dialog.
However, on 5.0 (API 21)+ devices this did have the side effect of coloring the top most system bar black for the time the
FacebookActivity
was active.To fix this I added a style in
res/values-v21/styles.xml
This made the theme completely transparent and removed the progress dialog.
Finally, one thing to note with solutions that recommend using
@android:style/Theme.NoDisplay
is that this will not work on Android Marshmallow 6.0 (API 23)+ and should probably be avoided in future.I had the same problem with facebook sdk 4.x. When I click the facebook login button the Facebook Activity appears translucent but it shows a progress bar. Luckily we can disable this progress bar in the theme. So the Facebook Activity is declared as
All we have to do is create a style that inherits from
Theme.Translucent.NoTitleBar
and hides the progress bar:Now set the theme of the activity to our new theme:
Voila! The ProgressBar before login is gone.