1
edit
Changes
no edit summary
<source lang="java">
<?xml version="1.0" encoding="utf-8"?>
</source>
=== 67.2. Create Add Contact Activity ===This class will be responsible for taking care of adding new contact to the contact list.<br/>67.2.1. Create a new class called ''AddContactActivity.java'' in the same package as the main activity file.
<source lang="java">
package cs.ecl.team1.android;
</source>
<source lang="java">
private String firstName;
</source>
<source lang="java">
firstName = ((EditText) findViewById(R.id.firstName)).getText().toString();
</source>
<source lang="java">
@Override
</source>
=== 67.3. Add Contact Activity to the Android Manifest ===67.3.1. Just add this line to the list of activities in ''AndroidManifest.xml''
<source lang="java">
<activity android:label="Add Contact" android:name="AddContactActivity"></activity>
</source>
=== 67.4. Implement Add Contact in the main activity class ===67.4.1. First step is to create an instance of ''Intent'' to pass the current object to the activity and then start the activity for the ''Add Contact'' when it's selected from the menu items.
<source lang="java">
case R.id.item1:
</source>
<source lang="java">
@Override
}
else {
}
displayData(studentList);
}
</source>
== 7.5. Add Contact in Action ==
7.5.1. Select the 'Add Contact' in the menu<br/>
[[Image: menu.png | 200px]]<br/><br/>
[[Image: add_1.png | 200px]]<br/>
7.5.2. Enter information of the new contact<br/>
[[Image: add_2.png | 200px]]<br/>
7.5.3. The new contact will be appeared in the list of contacts.<br/>
[[Image: added.png | 200px]]<br/>