private void initializeActionBar() { getSupportActionBar() .setTitle( recipient == null ? getString(R.string.AndroidManifest__media_overview) : getString( R.string.AndroidManifest__media_overview_named, recipient.toShortString())); }
private void initializeResources() { threadId = getIntent().getLongExtra(THREAD_ID_EXTRA, -1); noImages = (TextView) findViewById(R.id.no_images); gridView = (RecyclerView) findViewById(R.id.media_grid); gridManager = new GridLayoutManager(this, getResources().getInteger(R.integer.media_overview_cols)); gridView.setLayoutManager(gridManager); gridView.setHasFixedSize(true); final long recipientId = getIntent().getLongExtra(RECIPIENT_EXTRA, -1); if (recipientId > -1) { recipient = RecipientFactory.getRecipientForId(this, recipientId, true); recipient.addListener( new Recipient.RecipientModifiedListener() { @Override public void onModified(Recipient recipient) { initializeActionBar(); } }); } else { recipient = null; } }