Edit contact

相关类
packages/apps/Contacts/src/com/android/contacts/activities/ContactEditorActivity.java
packages/apps/Contacts/src/com/android/contacts/editor/ContactEditorFragment.java
packages/apps/Contacts/src/com/android/contacts/ContactSaveService.java
packages/apps/Contacts/src/com/android/contacts/editor/RawContactEditorView.java
packages/apps/Contacts/src/com/android/contacts/model/RawContactDeltaList.java

Edit contact interface is modified from 8.0 ContactEditorActivity, but is also compatible with old contacts editing interface CompactContactEditorActivity

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!-- Edit or create a contact with only the most important fields displayed initially. -->
<activity
android:name=".activities.ContactEditorActivity"
android:theme="@style/EditorActivityTheme">
<intent-filter>
<action android:name="android.intent.action.INSERT"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="vnd.android.cursor.dir/person"/>
<data android:mimeType="vnd.android.cursor.dir/contact"/>
<data android:mimeType="vnd.android.cursor.dir/raw_contact"/>
</intent-filter>
</activity>
<!-- Keep support for apps that expect the Compact editor -->
<activity-alias
android:name="com.android.contacts.activities.CompactContactEditorActivity"
android:exported="true"
android:targetActivity=".activities.ContactEditorActivity">
<intent-filter android:priority="-1">
<action android:name="android.intent.action.INSERT"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="vnd.android.cursor.dir/person"/>
<Data Android: mimeType = "vnd.android.cursor.dir / Contact" />
<Data Android: mimeType = "vnd.android.cursor.dir / raw_contact" />
</ Intent-filter>
</ Alias-Activity>
start editing a contact interface points under normal circumstances both cases, existing_contact and new_contact

. 1
2
. 3
. 4
. 5
. 6
. 7
. 8
. 9
10
. 11
12 is
13 is
14
@Override
public void the onCreate (the Bundle savedState) {
super.onCreate (savedState);
......
IF (Intent.ACTION_EDIT.equals (Action)) {
mActionBarTitleResId R.string.contact_editor_title_existing_contact =;
} the else {
mActionBarTitleResId = R.string.contact_editor_title_new_contact;
}
......
}
the onCreate method ContactEditorActivity created and the call ContactEditorFragment, is responsible for the overall operation and maintenance interface by editing the Fragment, ContactEditorFragment mainly used in custom ViewRawContactEditorView to display and edit contact data to form a complete user interaction

Follow-up work to save the contact data edited by the ContactSaveService be responsible for completing the class, should be noted that ContactSaveService is a IntentServer, with just right here, when processed quickly Intent task will immediately free up resources
------- ---------

Guess you like

Origin www.cnblogs.com/ly570/p/11414323.html