Android Programming Tutorials
...
TUTORIAL 12 Getting More Active In this tutorial, we will add support for both creating new restaurants and editing ones that we ...
Getting More Active package apt.tutorial; import android.app.Activity; import android.os.Bundle; public class DetailForm extends ...
Getting More Active </application> </manifest> Notice the second element, referencing the DetailForm class. Also no ...
Getting More Active <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent ...
Getting More Active Then, we need to add all our logic for accessing the various form widgets, plus an onSave listener for our S ...
Getting More Active break; case R.id.take_out: type="take_out"; break; case R.id.delivery: type="delivery"; break; } } }; Step # ...
Getting More Active @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentVi ...
Getting More Active Next, convert the onListClick object to an onListItemClick() method (available to us on ListActivity) and ha ...
Getting More Active @Override public void onDestroy() { super.onDestroy(); helper.close(); } Now that we have a handle to the da ...
Getting More Active c.close(); } Step #7: Add an "Add" Menu Option................................................. We have most ...
Getting More Active return(true); } return(super.onOptionsItemSelected(item)); } Here, we launch the DetailForm activity without ...
Getting More Active type="sit_down"; break; case R.id.take_out: type="take_out"; break; case R.id.delivery: type="delivery"; bre ...
Getting More Active Figure 22. The new-and-improved LunchList However, it will have an "add" menu option: 121 ...
Getting More Active Figure 23. The LunchList option menu, with Add If you choose the "add" menu option, it will bring up a blank ...
Getting More Active Figure 24. The DetailForm activity If you fill out the form and click Save, it will return you to the LunchL ...
Getting More Active Figure 25. The LunchList with an added Restaurant If you click an existing restaurant, it will bring up the ...
Getting More Active Figure 26. The DetailForm on an existing Restaurant Making changes and clicking Save will update the databas ...
Getting More Active Figure 27. The LunchList with an edited Restaurant Here is one implementation of LunchList that incorporates ...
Getting More Active public class LunchList extends ListActivity { public final static String ID_EXTRA="apt.tutorial._ID"; Cursor ...
«
3
4
5
6
7
8
9
10
11
12
»
Free download pdf