Fix crash on Huawei devices (#6365)

This commit is contained in:
ByteHamster 2023-03-06 21:39:47 +01:00 committed by GitHub
parent 5e75c968ad
commit d8d94878a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -20,7 +20,12 @@ public abstract class CastEnabledActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
canCast = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS;
if (canCast) {
CastContext.getSharedInstance(this);
try {
CastContext.getSharedInstance(this);
} catch (Exception e) {
e.printStackTrace();
canCast = false;
}
}
}