3bfd07fe84e3eb182c9a1ba47d673d9499265063
[unical.git] / src / ro / ieval / unical / mainActivity.java
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.view.Menu;
7 import android.view.MenuInflater;
8 import android.view.MenuItem;
9
10 public class mainActivity extends android.app.Activity {
11
12 @Override
13 protected void onCreate(Bundle savedInstanceState) {
14 // All Begins here :)
15 // And here it began the olympic app that does olympic thing
16
17 //log in
18 super.onCreate(savedInstanceState);
19
20 final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
21 if(prefs.getBoolean("FirstTime", true)) {
22 prefs.edit().putBoolean("FirstTime", false).commit();
23 Intent i=new Intent(this,loginActivity.class);
24 startActivity(i);
25 }
26 }
27
28 @Override
29 public boolean onCreateOptionsMenu(Menu menu) {
30 // TODO Auto-generated method stub
31 MenuInflater inflater = getMenuInflater();
32 inflater.inflate(R.menu.options, menu);
33 return true;
34 }
35
36 @Override
37 public boolean onOptionsItemSelected(MenuItem item) {
38 // Handle item selection
39 switch (item.getItemId()) {
40 case R.id.NewEvent:
41 Intent i=new Intent(this,addEventActivity.class);
42 startActivity(i);
43 return true;
44 default:
45 return true;
46 }
47 }
48 }
This page took 0.022633 seconds and 3 git commands to generate.