]> git.somenet.org - android/helloworld.git/blob - app/src/main/java/org/somenet/android/helloworld2/MainActivity.java
App as generated by Android Studio.
[android/helloworld.git] / app / src / main / java / org / somenet / android / helloworld2 / MainActivity.java
1 package org.somenet.android.helloworld2;
2
3 import android.support.v7.app.AppCompatActivity;
4 import android.os.Bundle;
5 import android.view.Menu;
6 import android.view.MenuItem;
7
8 public class MainActivity extends AppCompatActivity {
9
10     @Override
11     protected void onCreate(Bundle savedInstanceState) {
12         super.onCreate(savedInstanceState);
13         setContentView(R.layout.activity_main);
14     }
15
16     @Override
17     public boolean onCreateOptionsMenu(Menu menu) {
18         // Inflate the menu; this adds items to the action bar if it is present.
19         getMenuInflater().inflate(R.menu.menu_main, menu);
20         return true;
21     }
22
23     @Override
24     public boolean onOptionsItemSelected(MenuItem item) {
25         // Handle action bar item clicks here. The action bar will
26         // automatically handle clicks on the Home/Up button, so long
27         // as you specify a parent activity in AndroidManifest.xml.
28         int id = item.getItemId();
29
30         //noinspection SimplifiableIfStatement
31         if (id == R.id.action_settings) {
32             return true;
33         }
34
35         return super.onOptionsItemSelected(item);
36     }
37 }