Cornholio2108 / BestAlarm

0 stars 0 forks source link

AlarmScreen shown multiple times on phone orientation change #34

Closed Cornholio2108 closed 4 years ago

Cornholio2108 commented 4 years ago

When the Alarm screen is shown while phone is locked and the phone orientation changes then the alarm screen will be shown multiple times causing the alarm sound and vibration to play multiple times in the background and not stop when dismissing the alarm.

Possible solutions:

  1. Remove or set to false:

        <item name="android:windowIsTranslucent">false</item>
    <item name="android:windowIsFloating">false</item>
  2. Remove orientation change from manifest and set in activity:

        if(android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
    {
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTAIT);
    }
  3. New styles.xml in values-v26 and set there:

        <item name="android:windowIsTranslucent">false</item>
    <item name="android:windowIsFloating">false</item>
Cornholio2108 commented 4 years ago

fixed