1 package ro
.ieval
.unical
;
2 import android
.content
.Intent
;
3 import android
.content
.SharedPreferences
;
4 import android
.os
.Bundle
;
5 import android
.preference
.PreferenceManager
;
6 import android
.provider
.CalendarContract
.Events
;
7 import android
.view
.Menu
;
8 import android
.view
.MenuInflater
;
9 import android
.view
.MenuItem
;
11 public class MainActivity
extends android
.app
.Activity
{
14 protected void onCreate(final Bundle savedInstanceState
) {
15 super.onCreate(savedInstanceState
);
17 final SharedPreferences prefs
=PreferenceManager
.getDefaultSharedPreferences(this);
18 if(prefs
.getBoolean("FirstTime", true)) {
19 prefs
.edit().putBoolean("FirstTime", false).commit();
20 final Intent i
=new Intent(this,LoginActivity
.class);
24 DisplayEventActivity
.displayEvent(this, Event
.getEventsByCalendar(this,
25 Calendar
.getAllCalendars(this)[0]._id
, Events
.DTSTART
)[0]);
29 public boolean onCreateOptionsMenu(final Menu menu
) {
30 final MenuInflater inflater
= getMenuInflater();
31 inflater
.inflate(R
.menu
.main
, menu
);
36 public boolean onOptionsItemSelected(final MenuItem item
) {
37 switch (item
.getItemId()) {
39 final Intent i
=new Intent(this,AddEventActivity
.class);