FileDocCategorySizeDatePackage
DayActivity.javaAPI DocAndroid 1.5 API2762Wed May 06 22:42:42 BST 2009com.android.calendar

DayActivity

public class DayActivity extends CalendarActivity implements ViewSwitcher.ViewFactory

Fields Summary
private static final int
VIEW_ID
The view id used for all the views we create. It's OK to have all child views have the same ID. This ID is used to pick which view receives focus when a view hierarchy is saved / restore
Constructors Summary
Methods Summary
public android.view.ViewmakeView()

        DayView view = new DayView(this);
        view.setId(VIEW_ID);
        view.setLayoutParams(new ViewSwitcher.LayoutParams(
                LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        view.setSelectedDay(mSelectedDay);
        return view;
    
protected voidonCreate(android.os.Bundle icicle)


    
        
        super.onCreate(icicle);
        setContentView(R.layout.day_activity);

        mSelectedDay = Utils.timeFromIntent(getIntent());
        mViewSwitcher = (ViewSwitcher) findViewById(R.id.switcher);
        mViewSwitcher.setFactory(this);
        mViewSwitcher.getCurrentView().requestFocus();
        mProgressBar = (ProgressBar) findViewById(R.id.progress_circular);

        // Record Day View as the (new) default detailed view.
        String activityString = CalendarApplication.ACTIVITY_NAMES[CalendarApplication.DAY_VIEW_ID];
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putString(CalendarPreferenceActivity.KEY_DETAILED_VIEW, activityString);

        // Record Day View as the (new) start view
        editor.putString(CalendarPreferenceActivity.KEY_START_VIEW, activityString);
        editor.commit();
    
protected voidonPause()

        super.onPause();
        CalendarView view = (CalendarView) mViewSwitcher.getCurrentView();
        mSelectedDay = view.getSelectedDay();