@Override public void onResume() { super.onResume(); if (view == null) { view = (CustomYearDrawable) this.findViewById(R.id.year_view_custom); if (view == null) return; } int width = getWindowManager().getDefaultDisplay().getWidth(); int height = getWindowManager().getDefaultDisplay().getHeight(); if (width > height) { // Landscape view.initialise(selectedDate, CustomYearDrawable.LANDSCAPE); } else { // portrait view.initialise(selectedDate, CustomYearDrawable.PORTRAIT); } view.setOnTouchListener(this); }
@Override public void onResume() { super.onResume(); updateLayout(); }