private void intiliaze() { pb = (ProgressBar) findViewById(R.id.pb); mGridView = (GridView) findViewById(R.id.cal_gridview); month = Calendar.getInstance(); adapter = new NotesCalendarAdapter(month); mGridView.setAdapter(adapter); TextView title = (TextView) findViewById(R.id.title); title.setText(android.text.format.DateFormat.format("MMMM yyyy", month)); ImageView previous = (ImageView) findViewById(R.id.previous); ImageView next = (ImageView) findViewById(R.id.next); previous.setOnClickListener(this); next.setOnClickListener(this); mMenu = new CustomMenu(Calender.this, Calender.this, getLayoutInflater()); mMenu.setHideOnSelect(true); mMenu.setItemsPerLineInPortraitOrientation(3); mMenu.setItemsPerLineInLandscapeOrientation(8); loadMenuItems(); }