()
| 505 | } |
| 506 | |
| 507 | @Override |
| 508 | protected void onResume() { |
| 509 | Log.d("Resume " + this.getClass().getName()); |
| 510 | super.onResume(); |
| 511 | |
| 512 | visible = true; |
| 513 | |
| 514 | if (!(this instanceof ActivityMain)) { |
| 515 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); |
| 516 | prefs.edit().putString("last_activity", this.getClass().getName()).apply(); |
| 517 | } |
| 518 | |
| 519 | boolean contacts = hasPermission(Manifest.permission.READ_CONTACTS); |
| 520 | if (this.contacts != contacts && |
| 521 | !this.getClass().equals(ActivitySetup.class) && |
| 522 | !this.getClass().equals(ActivityCompose.class)) { |
| 523 | Log.i("Contacts permission=" + contacts); |
| 524 | finish(); |
| 525 | startActivity(getIntent()); |
| 526 | } else |
| 527 | checkAuthentication(true); |
| 528 | } |
| 529 | |
| 530 | @Override |
| 531 | protected void onPause() { |
nothing calls this directly
no test coverage detected