+ private void setProfile(Profile profile) {
+ ProfileDetailModel model = new ViewModelProvider(this).get(ProfileDetailModel.class);
+ CollapsingToolbarLayout appBarLayout = findViewById(R.id.toolbar_layout);
+ if (appBarLayout != null) {
+ if (profile != null)
+ appBarLayout.setTitle(profile.getName());
+ else
+ appBarLayout.setTitle(getResources().getString(R.string.new_profile_title));
+ }
+ model.setValuesFromProfile(profile);
+ }
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ super.onCreateOptionsMenu(menu);
+ debug("profiles", "[activity] Creating profile details options menu");
+ if (mFragment != null)
+ mFragment.onCreateOptionsMenu(menu, getMenuInflater());