Skip to content

Commit

Permalink
fix crash on first install launch
Browse files Browse the repository at this point in the history
  • Loading branch information
CaydenPierce committed Oct 7, 2024
1 parent 5104523 commit 7e98886
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);
mBound = false;

permissionsUtils = new PermissionsUtils(this, TAG);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
!= PackageManager.PERMISSION_GRANTED) {
gettingPermissions = true;
}

//setup the nav bar
NavHostFragment navHostFragment = (NavHostFragment) getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment);
Log.d(TAG, getSupportFragmentManager().getFragments().toString());
Expand All @@ -88,7 +94,10 @@ public void onStart() {
super.onStart();
UiUtils.setupTitle(this, "AugmentOS");

permissionsUtils = new PermissionsUtils(this, TAG);
if (permissionsUtils == null) {
permissionsUtils = new PermissionsUtils(this, TAG);
}

if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO)
!= PackageManager.PERMISSION_GRANTED) {
gettingPermissions = true;
Expand Down

0 comments on commit 7e98886

Please sign in to comment.