Fix crash on Huawei devices (#6365)
This commit is contained in:
parent
5e75c968ad
commit
d8d94878a2
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue