Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reader_activity_post_list); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } if (getIntent().hasExtra(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) getIntent().getSerializableExtra(ReaderConstants.ARG_POST_LIST_TYPE); } else { mPostListType = ReaderTypes.DEFAULT_POST_LIST_TYPE; } if (getPostListType() == ReaderPostListType.TAG_PREVIEW || getPostListType() == ReaderPostListType.BLOG_PREVIEW) { toolbar.setNavigationIcon(R.drawable.ic_cross_white_24dp); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) { setTitle(R.string.reader_title_blog_preview); if (savedInstanceState == null) { long blogId = getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID, 0); long feedId = getIntent().getLongExtra(ReaderConstants.ARG_FEED_ID, 0); if (feedId != 0) { showListFragmentForFeed(feedId); mSiteId = feedId; } else { showListFragmentForBlog(blogId); mSiteId = blogId; } } } else if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { setTitle(R.string.reader_title_tag_preview); ReaderTag tag = (ReaderTag) getIntent().getSerializableExtra(ReaderConstants.ARG_TAG); if (tag != null && savedInstanceState == null) { showListFragmentForTag(tag, mPostListType); } } } if (savedInstanceState != null && savedInstanceState.containsKey(ReaderConstants.KEY_ACTIVITY_TITLE)) { setTitle(savedInstanceState.getString(ReaderConstants.KEY_ACTIVITY_TITLE)); } }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.reader_activity_post_list); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } if (getIntent().hasExtra(ReaderConstants.ARG_POST_LIST_TYPE)) { mPostListType = (ReaderPostListType) getIntent().getSerializableExtra(ReaderConstants.ARG_POST_LIST_TYPE); } else { mPostListType = ReaderTypes.DEFAULT_POST_LIST_TYPE; } if (getPostListType() == ReaderPostListType.TAG_PREVIEW || getPostListType() == ReaderPostListType.BLOG_PREVIEW) { toolbar.setNavigationIcon(R.drawable.ic_cross_white_24dp); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { finish(); } }); if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) { setTitle(R.string.reader_title_blog_preview); if (savedInstanceState == null) { long blogId = getIntent().getLongExtra(ReaderConstants.ARG_BLOG_ID, 0); long feedId = getIntent().getLongExtra(ReaderConstants.ARG_FEED_ID, 0); if (feedId != 0) { showListFragmentForFeed(feedId); mSiteId = feedId; } else { showListFragmentForBlog(blogId); mSiteId = blogId; } } else { mSiteId = savedInstanceState.getLong(ReaderConstants.KEY_SITE_ID); } } else if (getPostListType() == ReaderPostListType.TAG_PREVIEW) { setTitle(R.string.reader_title_tag_preview); ReaderTag tag = (ReaderTag) getIntent().getSerializableExtra(ReaderConstants.ARG_TAG); if (tag != null && savedInstanceState == null) { showListFragmentForTag(tag, mPostListType); } } } if (savedInstanceState != null && savedInstanceState.containsKey(ReaderConstants.KEY_ACTIVITY_TITLE)) { setTitle(savedInstanceState.getString(ReaderConstants.KEY_ACTIVITY_TITLE)); } }