Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Handheld.StartActivityIndicator() not working in 2019.3

Discussion in 'iOS and tvOS' started by artemio_morales, Feb 12, 2020.

  1. artemio_morales

    artemio_morales

    Joined:
    Nov 29, 2015
    Posts:
    19
    Hello, I've tried using Handheld.StartActivityIndicator() and it's not working as expected.

    I'm referencing this link: https://docs.unity3d.com/ScriptReference/Handheld.StartActivityIndicator.html

    My code is as follows:

    Code (CSharp):
    1.  
    2.  
    3. #if UNITY_IOS
    4. using UnityEngine.iOS;
    5. #endif
    6.  
    7. // The following functions are inside a MonoBehaviour
    8. private void ExecuteFadeIn()
    9. {
    10.     StartCoroutine(HideActivityIndicator());
    11.     // Other Logic
    12. }
    13.  
    14. private IEnumerator ShowActivityIndicator()
    15. {
    16.    #if UNITY_IPHONE
    17.       Handheld.SetActivityIndicatorStyle(ActivityIndicatorStyle.Gray);
    18.    #elif UNITY_ANDROID
    19.       Handheld.SetActivityIndicatorStyle(AndroidActivityIndicatorStyle.Small);
    20.    #endif
    21.  
    22.    Handheld.StartActivityIndicator();
    23.    yield return new WaitForSeconds(0);
    24. }
    25.  
    Is this correct? Is there something I'm missing? Any help appreciated!

    Note: I'm on iOS 12.4.1.
     
    quangtqag likes this.
  2. artemio_morales

    artemio_morales

    Joined:
    Nov 29, 2015
    Posts:
    19
    Hey all, figured out the problem. Turns out the indicator works perfectly, I just couldn't see it because the indicator style was gray and my overlay was black :p

    The fix was changing the activity indicator style to white.