content will override the “default” one • No need to override everything • Per screen density (drawable-mdpi, drawable-hdpi, etc) • Per device sizes (layout-sw600dp, layout- h560dp, etc) • Per language (values-it, values-es, etc) • Mixed (drawable-sw600dp-xxhpi)
container that handle user interaction for a specific purpose. • Its content will be “prepared” inside the onCreate(Bundle) callback • mostly loading an xml layout • and it’s ready to go
their relationships) are described inside a layout (.xml) file • use attributes, strings and styles • View with ID can be fetch by the activity findViewById(R.id.main_list); • Reusable UI (also across other layouts)
UI that can be placed in an Activity (through FragmentManager). • Fragment is closely tied to the Activity it is in (lifecycle dependency) • and can not be used apart from one. • Specialized piece of a larger Activity • Reusable logic.
AndroidManifest.xml to be launched (!) • Create an intent, with the activity class, then start it Intent create = new Intent(this, HelloActivity.class); startActivity(create); • if the activity returns something startActivityForResult(Intent, int)
store the result Intent data = new Intent(); data.putExtra(“res", field.getText()); • Set the result of the activity setResult(RESULT_OK, data); Terminate the activity finish();
and display the content of a “list of things”. • Reflect data changes to the view TodoAdapter adapter = new TodoAdapter(); ListView listView = (ListView) findViewById(R.id.main_list); listView.setAdapter(adapter);