Hi,
Does anybody know, how to position the Activity Indicator in the center. I am using the Handheld.StartActivityIndicator() and the indicator shows up in the upper left corner.
Thanks
Hi,
Does anybody know, how to position the Activity Indicator in the center. I am using the Handheld.StartActivityIndicator() and the indicator shows up in the upper left corner.
Thanks
I see tons of people asking about this here and elsewhere (answers), but no one is getting a response. Is it really that difficult to choose where this displays on the screen? iOS shows in the center, why doesn’t Android?
I’m looking for an answer too…
Looking for answer…
Anyone found a solution?
C’mon unity devs! Please fix this!
I’m very surprised that Unity hasn’t exposed an interface to do this. I needed to display the Android activity indicator in the center of the screen and was able to figure out a quick hack that works (at least with Unity 5.6.5).
Since no one else has chimed in with a solution or workaround, I’m posting a couple of simple projects on Github that show how I made this work in case someone out there might find it useful.
In a nutshell, I created a very simple plugin that walks through the content view to find the ProgressBar Unity creates on the fly and sets its layout params to center it on screen. The tricky thing here is that you have to do this on the UI thread (i.e. the same thread on which Unity created the layout).
On the C# side, I simply call this plugin’s method after calling
Handheld.StartActivityIndicator(). It must be called after this method because the ProgressBar seems to be created programmatically here.
The Unity java plugin source is here:
https://github.com/mavericknico/AndroidActivityIndicator
A simple Unity test project using it is here:
https://github.com/mavericknico/AndroidProgressBarTest
The plugin is currently hard coded to center the activity indicator, but it should be fairly trivial for someone to make this more generic. I hope someone finds it useful!
BTW, note that I’m on Unity 5.x and needed to create a plugin, but with newer versions of Unity I believe you can add java source directly to your unity project and call it from C# w/o having to compile it into an aar.
Hey Thanks for your Script, Looks like Unity doesn’t care at all about this issue…
Nevertheless your solution seems not to be working for me though. I just used the plugin folder from your example project and run the function. Did I miss anything?
Thanks for your support!
Hi Frederic,
Sorry for the late response.
If you mean you’re calling the java function directly, make sure you’re calling the plugin from your project after the call to Handheld.StartActivityIndicator(). Unity seems to be creating it on the fly in that call.
If you mean you’re calling the C# method UnityActivityIndicator.ShowActivityIndicator() from my sample project, well that should be doing the right thing. I can only verify it’s working for me on Unity version 5.6.5p4; I haven’t tested it on any other versions.
Hope this helps!
Regards,
Nick
One other thing to check: make sure that after you import the aar into your project, check that Android is selected as a platform.

Hey thanks for your respone,
I am using 2018.2.20f, though a little bit newer. I guess I should try to implement the java code directly into unity but I am not exactly sure how to. I will try around
I’d be interested in a step-by-set guide to how to set this up on modern Unity, as it is a bit confusing to me.
Still no solution? Come on unity, this must be fixed!
2024 and still the same problem with unity 2023