Custom fields on new contact

前端 未结 2 759
温柔的废话
温柔的废话 2020-12-19 15:32

\"new

This is the \'add new contact\' window. Is it possible to create custom data fields in this win

相关标签:
2条回答
  • 2020-12-19 15:54

    It seems like the only way to do it, is to catch the intent and show you're own edit contact activity( at least with android 2.1 and 2.3 ). I tries all day long to make a workable BroadcastReceiver working. but I never succed.

    source : https://groups.google.com/forum/?fromgroups#!topic/android-developers/bKpXE1kn4kI and Custom accountType "edit contact" and "add contact" shows only name

    0 讨论(0)
  • 2020-12-19 15:58

    It is possible to launch a new Add New Contact activity when the user clicks on the add new contact button. For that you will have to create your own activity and setContentView(R.layout.YOUR_CUSTOM_ACTIVITY_SCREEN). Now the next step is important. Add the following lines to the ManifestFile of your application:

    <activity android:name=".YOUR_CUSTOM_ACTIVITY" >
            <intent-filter>
                <action android:name="android.intent.action.INSERT" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.dir/contact"/>
            </intent-filter>
        </activity>
    

    Now when the user click to add a new contact he will be shown 2 options. One will be your application and other would be the default activity to add contact.

    Hope this answer helps.

    0 讨论(0)
提交回复
热议问题