@@ -314,6 +314,10 @@ protected void onCreate(Bundle savedInstanceState) {
314314 if (ca .isMasterDataAvailable () > 0 ) {
315315 loadLanguages ();
316316 }
317+ navigationView .setCheckedItem (R .id .nav_home );
318+ if (checkRequirements ()) {
319+ onAllRequirementsMet ();
320+ }
317321 } catch (Exception e ) {
318322 Sentry .captureException (e );
319323 }
@@ -728,9 +732,13 @@ public boolean onNavigationItemSelected(MenuItem item) {
728732 }
729733
730734 } else if (id == R .id .nav_renewal ) {
731- Intent i = new Intent (this , RenewList .class );
732- startActivity (i );
733-
735+ String officerCode = global .getOfficerCode ();
736+ if (officerCode == null ) {
737+ ShowEnrolmentOfficerDialog ();
738+ } else {
739+ Intent i = new Intent (this , RenewList .class );
740+ startActivity (i );
741+ }
734742 } else if (id == R .id .nav_reports ) {
735743 Global global = (Global ) getApplicationContext ();
736744 if (global .isLoggedIn ()) {
@@ -819,10 +827,12 @@ public MasterDataAsync(@NonNull MainActivity context) {
819827 @ Override
820828 protected void onPreExecute () {
821829 Context context = activity .get ();
822- if (context == null ) {
823- return ;
824- }
825- pd = new WeakReference <>(AndroidUtils .showProgressDialog (context , R .string .Sync , R .string .DownloadingMasterData ));
830+ if (context == null ) return ;
831+ ((Activity ) context ).runOnUiThread (() -> {
832+ pd = new WeakReference <>(
833+ AndroidUtils .showProgressDialog (context , R .string .Sync , R .string .DownloadingMasterData )
834+ );
835+ });
826836 }
827837
828838 @ Override
0 commit comments