]>
Commit | Line | Data |
---|---|---|
bdd8f09c | 1 | package ro.ieval.unical; |
7be52756 | 2 | import android.content.Intent; |
8188ed47 | 3 | import android.content.SharedPreferences; |
bdd8f09c | 4 | import android.os.Bundle; |
8188ed47 | 5 | import android.preference.PreferenceManager; |
eb5b6684 PT |
6 | import android.view.Menu; |
7 | import android.view.MenuInflater; | |
8 | import android.view.MenuItem; | |
bdd8f09c PT |
9 | |
10 | public class mainActivity extends android.app.Activity { | |
bdd8f09c PT |
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 | |
7be52756 | 16 | |
8188ed47 PT |
17 | //log in |
18 | super.onCreate(savedInstanceState); | |
eb5b6684 | 19 | |
8188ed47 PT |
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 | } | |
bdd8f09c | 26 | } |
eb5b6684 PT |
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 | } | |
bdd8f09c | 48 | } |