Ejemplo n.º 1
0
 private void OnTabLayoutOnTabSelected(object sender, TabLayout.TabSelectedEventArgs e)
 {
     if (e.Tab.Position == 2)
     {
         if (PermissionChecker.CheckSelfPermission(this, Android.Manifest.Permission.Camera) == (int)Permission.Granted &&
             PermissionChecker.CheckSelfPermission(this, Android.Manifest.Permission.WriteExternalStorage) == (int)Permission.Granted)
         {
             _prevTab.Select();
             var intent = new Intent(this, typeof(CameraActivity));
             StartActivity(intent);
         }
         else
         {
             //Replace for Permission request
             this.ShowAlert("Check your app permissions");
         }
     }
     else
     {
         SelectTab(e.Tab.Position);
         _prevTab = e.Tab;
         BasePresenter.User.SelectedTab = e.Tab.Position;
     }
 }