]> iEval git - unical.git/blame - src/ro/ieval/unical/MainActivity.java
Fix the three get functions
[unical.git] / src / ro / ieval / unical / MainActivity.java
CommitLineData
5cf4714f
MG
1package ro.ieval.unical;
2import android.content.Intent;
3import android.content.SharedPreferences;
4import android.os.Bundle;
5import android.preference.PreferenceManager;
6import android.provider.CalendarContract.Events;
7import android.view.Menu;
8import android.view.MenuInflater;
9import android.view.MenuItem;
10
11public class MainActivity extends android.app.Activity {
12
13 @Override
14 protected void onCreate(final Bundle savedInstanceState) {
15 super.onCreate(savedInstanceState);
16
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);
21 startActivity(i);
22 }
23
24 DisplayEventActivity.displayEvent(this, Event.getEventsByCalendar(this,
25 Calendar.getAllCalendars(this)[0]._id, Events.DTSTART)[0]);
26 }
27
28 @Override
29 public boolean onCreateOptionsMenu(final Menu menu) {
30 final MenuInflater inflater = getMenuInflater();
31 inflater.inflate(R.menu.main, menu);
32 return true;
33 }
34
35 @Override
36 public boolean onOptionsItemSelected(final MenuItem item) {
37 switch (item.getItemId()) {
38 case R.id.NewEvent:
39 final Intent i=new Intent(this,AddEventActivity.class);
40 startActivity(i);
41 return true;
42 default:
43 return false;
44 }
45 }
46}
This page took 0.026002 seconds and 4 git commands to generate.