diff --git a/.gitignore b/.gitignore index 162a568..6f7720e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -.idea/.name -.idea/compiler.xml -.idea/dictionaries/Bucky.xml +.idea/ *.iml -.idea/misc.xml -*.xml \ No newline at end of file +*.xml diff --git a/Android_Beginners/010_States of an Activity/activity_main.xml b/Android_Beginners/010_States of an Activity/activity_main.xml deleted file mode 100644 index 2b1db79..0000000 --- a/Android_Beginners/010_States of an Activity/activity_main.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - diff --git a/Android_Beginners/011-012 User Interface/012 User Interface.txt b/Android_Beginners/011-012 User Interface/012 User Interface.txt new file mode 100644 index 0000000..3323fa5 --- /dev/null +++ b/Android_Beginners/011-012 User Interface/012 User Interface.txt @@ -0,0 +1,106 @@ +[source code] Android Development Tutorials - 11 & 12 - User Interface + +***** Main Activity.java +package your.package.name + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.Menu; +import android.view.MenuItem; + +public class MainActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.menu_main, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + int id = item.getItemId(); + + //noinspection SimplifiableIfStatement + if (id == R.id.action_settings) { + return true; + } + + return super.onOptionsItemSelected(item); + } +} + + +***** activity_main.xml + + + + + + + + + +