Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dining_house); venue = getIntent().getParcelableExtra(Constants.Dining.DINING_HOUSE); dateFormat = new SimpleDateFormat("yyyy-MM-dd"); setTitle(venue.getShortName()); houseMenuViewpager = (ViewPager) this.findViewById(R.id.dining_house_menu_viewpager); houseHoursTextView = (TextView) this.findViewById(R.id.house_hours_text_view); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { houseImageView = (ImageView) this.findViewById(R.id.house_image_view); houseNameTextView = (TextView) this.findViewById(R.id.house_name_text_view); dateTextView = (TextView) this.findViewById(R.id.date_text_text_view); infoTextView = (TextView) this.findViewById(R.id.info_text_view); infoImageView = (ImageView) this.findViewById(R.id.info_image_view); backImageView = (ImageView) this.findViewById(R.id.back_image_view); forwardImageView = (ImageView) this.findViewById(R.id.forward_image_view); setViewsListener(); buildPortraitMenuPager(); houseNameTextView.setText(venue.getName()); dateTextView.setText("Today, " + getCurrentDate()); try { Picasso.with(this).load(venue.getIconURL()).placeholder(R.drawable.grey_rect).into(houseImageView); } catch (NullPointerException e) { Picasso.with(this).load(R.drawable.grey_rect).placeholder(R.drawable.grey_rect).into(houseImageView); } } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { houseHoursTextView.setText("Today, " + getCurrentDate()); buildLandscapeMenuPager(); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dining_house); venue = getIntent().getParcelableExtra(Constants.Dining.DINING_HOUSE); dateFormat = new SimpleDateFormat("yyyy-MM-dd"); setTitle(venue.getShortName()); houseMenuViewpager = (ViewPager) this.findViewById(R.id.dining_house_menu_viewpager); houseHoursTextView = (TextView) this.findViewById(R.id.house_hours_text_view); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { houseImageView = (ImageView) this.findViewById(R.id.house_image_view); houseNameTextView = (TextView) this.findViewById(R.id.house_name_text_view); dateTextView = (TextView) this.findViewById(R.id.date_text_text_view); infoTextView = (TextView) this.findViewById(R.id.info_text_view); infoImageView = (ImageView) this.findViewById(R.id.info_image_view); backImageView = (ImageView) this.findViewById(R.id.back_image_view); forwardImageView = (ImageView) this.findViewById(R.id.forward_image_view); setViewsListener(); buildPortraitMenuPager(); houseNameTextView.setText(venue.getName()); dateTextView.setText("Today, " + getCurrentDate()); if (venue.getIconURL() != null) { Picasso.with(this).load(venue.getIconURL()).placeholder(R.drawable.grey_rect).into(houseImageView); } else { Picasso.with(this).load(R.drawable.grey_rect).placeholder(R.drawable.grey_rect).into(houseImageView); } } else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { houseHoursTextView.setText("Today, " + getCurrentDate()); buildLandscapeMenuPager(); } }