Add a workaround for theme not being correctly applied
on some Android versions
This commit is contained in:
parent
5bc11077d7
commit
3d832cf6e8
|
@ -3,6 +3,7 @@ package dummydomain.yetanothercallblocker;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Parcelable;
|
||||
|
@ -89,6 +90,12 @@ public class MainActivity extends AppCompatActivity {
|
|||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
// workaround for a black/non-responsive activity after theme change
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
|
||||
&& Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
|
||||
getDelegate().setLocalNightMode(settings.getUiMode());
|
||||
}
|
||||
|
||||
super.onStart();
|
||||
|
||||
EventUtils.register(this);
|
||||
|
|
Loading…
Reference in New Issue