コード例 #1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // Get time to show e.g. a lectures starting time or 0 for now
    Intent i = getIntent();
    if (i != null && i.hasExtra(EVENT_TIME)) mEventTime = i.getLongExtra(EVENT_TIME, 0);

    // mViewPager = (ViewPager) findViewById(R.id.pager);
    calendarManager = new CalendarManager(this);

    // Set the time space between now and after this date and before this
    // Dates before the current date
    requestHandler.setParameter("pMonateVor", String.valueOf(MONTH_BEFORE));
    // Dates after the current date
    requestHandler.setParameter("pMonateNach", String.valueOf(MONTH_AFTER));

    SQLiteDatabase db = DatabaseManager.getDb(this);
    if (SyncManager.needSync(db, Const.SYNC_CALENDAR_IMPORT, TIME_TO_SYNC_CALENDAR)) {
      requestFetch();
    } else {
      isFetched = true;
      attachSectionPagerAdapter();
    }
  }
コード例 #2
0
 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
   super.onCreateOptionsMenu(menu);
   getMenuInflater().inflate(R.menu.menu_sync_calendar, menu);
   menuItemSwitchView = menu.findItem(R.id.action_switch_view_mode);
   return true;
 }